Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


setting editbox text?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
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?

PostPosted: Fri Aug 24, 2007 8:10 pm    Post subject: setting editbox text? Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Lorrenzo
Moderator
Reputation: 4

Joined: 02 Jun 2006
Posts: 3744

PostPosted: Fri Aug 24, 2007 8:11 pm    Post subject: Reply with quote

Uhm, pick the font you want from object inspector?
_________________
LAWLrrenzolicious
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Aug 24, 2007 8:12 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Fri Aug 24, 2007 8:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Aug 24, 2007 8:28 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Fri Aug 24, 2007 8:30 pm    Post subject: Reply with quote

an edit box is no different than a button, they are all windows and the implementation of fonts is the same.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Aug 24, 2007 8:37 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Fri Aug 24, 2007 8:40 pm    Post subject: Reply with quote

UnLmtD wrote:

Take a look at appalsap's IconHidder source code, it uses that API.

_________________
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Fri Aug 24, 2007 8:56 pm    Post subject: Reply with quote

You really should follow your own advice and read some tutorials:

http://www.winprog.org/tutorial/

Specifically, the bottom of http://www.winprog.org/tutorial/fonts.html

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Aug 24, 2007 8:57 pm    Post subject: Reply with quote

Heheh, I didn't see that part Wink

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Aug 25, 2007 3:05 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Aug 25, 2007 9:16 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sat Aug 25, 2007 11:24 am    Post subject: Reply with quote

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" Very Happy best


Last edited by Symbol on Sat Aug 25, 2007 12:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Aug 25, 2007 11:59 am    Post subject: Reply with quote

oib111 wrote:
thanks noz

Edit:

Doesn't work.



Erm...:
Back to top
View user's profile Send private message MSN Messenger
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Aug 25, 2007 12:58 pm    Post subject: Reply with quote

Heheh Wink ...=.'
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites