 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Aug 24, 2007 8:10 pm Post subject: setting editbox text? |
|
|
Well, I'm making a program. And whenever you type in the editbox it has this really ugly font. I want to know how to change the font that will be represented in the edit box. I tried searching for CreateFont() examples, but none of them were examples for edit boxes. If someone can give me an example code on how to do this with CreateFont() or any other way, it would be nice. Thanks.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Lorrenzo Moderator
Reputation: 4
Joined: 02 Jun 2006 Posts: 3744
|
Posted: Fri Aug 24, 2007 8:11 pm Post subject: |
|
|
Uhm, pick the font you want from object inspector?
_________________
LAWLrrenzolicious |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Aug 24, 2007 8:12 pm Post subject: |
|
|
Sry, I forgot to say this was C++. There is no object inspector. There is with wxDev-C++. But I don't use that.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Fri Aug 24, 2007 8:15 pm Post subject: |
|
|
Didn't appalsap explain to you how to use that on IRC?
Take a look at appalsap's IconHidder source code, it uses that API.
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Aug 24, 2007 8:28 pm Post subject: |
|
|
No he just told me that I could really only use the first and last parameter(size, and name of font).
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri Aug 24, 2007 8:30 pm Post subject: |
|
|
| an edit box is no different than a button, they are all windows and the implementation of fonts is the same.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Aug 24, 2007 8:37 pm Post subject: |
|
|
I know. But how do I set the font. My tutorial doesn't say how to set the font unless your printing text
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Fri Aug 24, 2007 8:40 pm Post subject: |
|
|
| UnLmtD wrote: |
Take a look at appalsap's IconHidder source code, it uses that API. |
_________________
|
|
| Back to top |
|
 |
DeltaFlyer Grandmaster Cheater
Reputation: 0
Joined: 22 Jul 2006 Posts: 666
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Aug 24, 2007 8:57 pm Post subject: |
|
|
Heheh, I didn't see that part
Edit:
Wtf is wrong with this?
| Code: |
SendDlgItemMessage(hwnd, IDC_MAIN_EDIT, WM_SETFONT, (WPARAM)"MS Sans Serif", TRUE);
|
It compiles fine. But when I run it doesn't work. The font is the same! Did I put it in the wrong place.
First I tried putting it under my edit box creation.
| Code: |
case WM_CREATE:
HWND hEdit;
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "",
WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL,
50, 50, 100, 20, hwnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL);
if(hEdit == NULL)
MessageBox(hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR);
SendDlgItemMessage(hwnd, IDC_MAIN_EDIT, WM_SETFONT, (WPARAM)"Times New Roman", TRUE);
break;
|
Then I tried putting it under WM_SETFONT
| Code: |
case WM_SETFONT:
SendDlgItemMessage(hwnd, IDC_MAIN_EDIT, WM_SETFONT, (WPARAM)"Times New Roman", TRUE);
break;
|
But still it doesn't work. Wtf is wrong?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sat Aug 25, 2007 3:05 am Post subject: |
|
|
| Code: | BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
// Create box and set font
HWND TextBox = CreateWindowEx(NULL, "EDIT", NULL, WS_CHILD | WS_VISIBLE,
0, 0, 200, 50, hWnd, (HMENU)EDIT_1, hInstance, NULL);
HFONT Font = CreateFont(0,0,0,0,0,0,0,0,0,0,0,0,0, "Times New Roman"); // Change the last param to your font.
SendDlgItemMessage(hWnd, EDIT_1, WM_SETFONT, (WPARAM)Font, TRUE);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
} |
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Aug 25, 2007 9:16 am Post subject: |
|
|
thanks noz
Edit:
Doesn't work.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat Aug 25, 2007 11:24 am Post subject: |
|
|
im not sure u can set a diffrent font of edit boxes, only free text, rich edit etc.. but maybe im wrong
edit: nvm its not what i thought it is =\
btw i suggest u font "Comic Sans MS" best
Last edited by Symbol on Sat Aug 25, 2007 12:11 pm; edited 1 time in total |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sat Aug 25, 2007 11:59 am Post subject: |
|
|
| oib111 wrote: | thanks noz
Edit:
Doesn't work. |
Erm...:
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Aug 25, 2007 12:58 pm Post subject: |
|
|
Heheh ...=.'
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|