c++ - Detect if event is taken - win32 -


this question has answer here:

i'm wondering if can me on since i've been looking around google , chances found don't understand how it. routine perform. have button 'a' , button 'b', if button 'a' pressed open messagebox. if button 'b' pressed open new window , display content window.

sorry vague basically, have 2 buttons on application. 1 labelled 'a' , 'b'. how tell application run through kind of loop check if buttons pressed? if first button clicked open message box, if second open window class. following how add new properties window class opened in same application?

i thinking of taking wm_command approach in switch statement, id's of cases , how correspond each button? -- can on problem here appreciated, code example more appreciated!

cheers

in win32 every button has numeric id. practice give buttons different ids. duty select values , assign these numbers buttons.

depending on environment: pure win32, mfc, else, details of defining values , assigning them different. can specify id while creating window:

hwnd winapi createwindow (   _in_opt_  lpctstr lpclassname,   _in_opt_  lpctstr lpwindowname,   _in_      dword dwstyle,   _in_      int x,   _in_      int y,   _in_      int nwidth,   _in_      int nheight,   _in_opt_  hwnd hwndparent,   _in_opt_  hmenu hmenu,   _in_opt_  hinstance hinstance,   _in_opt_  lpvoid lpparam ); 

the id passed in hmenu parameter. details in http://msdn.microsoft.com/en-us/library/windows/desktop/ms632679(v=vs.85).aspx. in windows window id cannot have menu. sounds funny, how implemented in mid 80-ties.

once assigned ids can , should use them in wm_command handler.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -