Click here to Skip to main content
15,918,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: List box scroll to bottom Pin
Roger Stewart4-Dec-02 10:56
professionalRoger Stewart4-Dec-02 10:56 
GeneralRe: List box scroll to bottom Pin
Shay Harel4-Dec-02 11:03
Shay Harel4-Dec-02 11:03 
GeneralRe: List box scroll to bottom Pin
Alvaro Mendez4-Dec-02 11:55
Alvaro Mendez4-Dec-02 11:55 
GeneralRe: List box scroll to bottom Pin
Roger Stewart4-Dec-02 13:36
professionalRoger Stewart4-Dec-02 13:36 
GeneralRe: List box scroll to bottom Pin
georgiek504-Dec-02 15:17
georgiek504-Dec-02 15:17 
GeneralKeyboard response in a dialog, not the main window--thanks a lot Pin
Sean_Yang4-Dec-02 9:59
Sean_Yang4-Dec-02 9:59 
GeneralRe: Keyboard response in a dialog, not the main window--thanks a lot Pin
RicoH5-Dec-02 1:35
RicoH5-Dec-02 1:35 
GeneralRe: Keyboard response in a dialog, not the main window--thanks a lot Pin
Sean_Yang5-Dec-02 7:03
Sean_Yang5-Dec-02 7:03 
Shall I declare a global HWND hmainwnd; and within the WinMain() function.

if (!(hwnd = CreateWindow ("MAINWINDOW", "1DoF Stepper Motor Haptic Device",
WS_OVERLAPPEDWINDOW,
0,0,
800, 150,
NULL, NULL, hCurrentInst, NULL)))
return (0);
hmainwnd = hwnd;//like this???


and then when triggering the dialog, I do
hwnddlg = CreateDialog(app_instance, "Experiment", hmainwnd, (DLGPROC) Parameter_Window_Exper);


But I did so, it doesn't work.
The sequence triggered is as following: Main->Dialog_Data->Dialog_Experiment. I want the Dialog_Experiment to respond my keyboard.


My code(simplified) is like this:should I change all NULL to hmainwnd?
~~~~~~~~~~~~~~~~~~~~~~~~~~~`
extern HWND hwnddlg;
int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst, LPSTR lpszCmdLine, int nCmdShow)
{
...
if (!RegisterClass (&wc)) {
MessageBox (NULL, (LPCTSTR) "WinMain(): RegisterClass() failed",
(LPCTSTR) "Error!", MB_OK | MB_ICONEXCLAMATION);
return(FALSE);
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}

return (msg.wParam);
}
------------------------------------------
LRESULT CALLBACK MainWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
...
hwnddlg = CreateDialog(app_instance, "PARAMETER_WINDOW_DATA", NULL, (DLGPROC) Parameter_Window_Data);
}
-------------------------------------------
BOOL CALLBACK Parameter_Window_Data(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
...
DestroyWindow(hWnd);
hwnddlg = CreateDialog(app_instance, EXPER_INTRO_DIALOG, NULL, (DLGPROC) Parameter_Window_Exper);
}
-------------------------------------------
BOOL Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
case WM_CHAR:
switch(wParam)
{
case '1':
MessageBox(hmainwnd, "Happen?", "TEST Box", MB_OK);

record_data_pair(1);
break;
case '2'://0x32:
record_data_pair(2);
break;
case '3'://0x33:
record_data_pair(1);
break;
default:
break;
}
return FALSE;

}


Thanks
Sean
GeneralRe: Keyboard response in a dialog, not the main window--thanks a lot Pin
RicoH5-Dec-02 7:37
RicoH5-Dec-02 7:37 
GeneralRe: Keyboard response in a dialog, not the main window--thanks a lot Pin
Sean_Yang5-Dec-02 8:33
Sean_Yang5-Dec-02 8:33 
GeneralHELP! silly memory release problem( forJames.R.Twine) Pin
smartptr4-Dec-02 9:46
smartptr4-Dec-02 9:46 
GeneralRe: HELP! silly memory release problem( forJames.R.Twine) Pin
Christian Graus4-Dec-02 9:52
protectorChristian Graus4-Dec-02 9:52 
GeneralRe: HELP! silly memory release problem( forJames.R.Twine) Pin
smartptr4-Dec-02 9:56
smartptr4-Dec-02 9:56 
GeneralRe: HELP! silly memory release problem( forJames.R.Twine) Pin
Christian Graus4-Dec-02 10:33
protectorChristian Graus4-Dec-02 10:33 
GeneralRe: HELP! silly memory release problem( forJames.R.Twine) Pin
Navin4-Dec-02 10:37
Navin4-Dec-02 10:37 
GeneralFailed Serialize function Pin
act_x4-Dec-02 9:37
act_x4-Dec-02 9:37 
GeneralProblem with Dumping Object (new of MFC) and FreeLibrary Pin
leander4-Dec-02 8:33
leander4-Dec-02 8:33 
GeneralRe: Problem with Dumping Object (new of MFC) and FreeLibrary Pin
Nick Parker4-Dec-02 8:56
protectorNick Parker4-Dec-02 8:56 
GeneralRe: Problem with Dumping Object (new of MFC) and FreeLibrary Pin
Ranjan Banerji4-Dec-02 9:26
Ranjan Banerji4-Dec-02 9:26 
GeneralRe: Problem with Dumping Object (new of MFC) and FreeLibrary Pin
leander4-Dec-02 21:58
leander4-Dec-02 21:58 
GeneralRe: Problem with Dumping Object (new of MFC) and FreeLibrary Pin
Alvaro Mendez4-Dec-02 9:34
Alvaro Mendez4-Dec-02 9:34 
Generaldrag on hDC Pin
Nicolas Siatras4-Dec-02 7:28
Nicolas Siatras4-Dec-02 7:28 
GeneralDrawing on a device independent bitmap Pin
David F Zimny4-Dec-02 6:50
David F Zimny4-Dec-02 6:50 
GeneralRe: Drawing on a device independent bitmap Pin
Christian Graus4-Dec-02 9:55
protectorChristian Graus4-Dec-02 9:55 
GeneralRe: Drawing on a device independent bitmap Pin
Paul M Watt4-Dec-02 14:44
mentorPaul M Watt4-Dec-02 14:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.