if (EfterSG == 1)
{
DestroyWindow(hKnappNEW);
DestroyWindow(hKnappRESUME);
DestroyWindow(hKnappEXIT);
DestroyWindow(hTextMAINMENU);
if (Skapar_saker == 1)
{
hKnappWest = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "West",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_TABSTOP,
150, 250, 50, 50, hwnd, (HMENU)ID_WEST_BUTTON, ´ GetModuleHandle(NULL), NULL);
if(hKnappWest == NULL)
MessageBox(hwnd, "Could not create push button.", "Error", MB_OK | MB_ICONERROR);
Skapar_saker = 2;
}
}]
Mullvad
Edited by - Mullvad on February 25, 2002 1:27:59 PM
Edited by - Mullvad on February 25, 2002 1:29:35 PM
Why cant I create controls after I have used destroyWindow??..
Why?? Heres some code where the create part doesnt work..
And dont wore about the if`s I have things that make the value correct to run create.
Mullvad
Is ID_WEST_BUTTON actually a menu resource, or is it the button image?
(Read the site FAQ. It contains information on how to format code in your posts).
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
(Read the site FAQ. It contains information on how to format code in your posts).
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
It is a button that is created directly at the window and the controls I using destroy window on is also button thats directly created at the window
Mullvad
I dont think you can change the resource ID of a button into a handle to a menu.
Invader X
Invader''s Realm
Invader X
Invader''s Realm
I dont know what you talk about I just trying to create a button after a have deleted some when using DestroyWindow but it doesnt work to create a new but the old one dissapers. Why doesnt the new West button come up??
Mullvad
Mullvad
Mullvad
I''m sorry, after reading the documentation I realize that the hMenu parameter of CreateWindowEx should allow you to use (HMENU)ID_WEST_BUTTON.
Invader X
Invader''s Realm
Invader X
Invader''s Realm
I''ll have to create a new project and play around because I don''t see errors. (Hopefully somebody will help out here before that since I wont have time to even try till Friday)
What is the formatted message returned if you use GetLastError() and FormatMessage() when the button fails to be created?
Invader X
Invader''s Realm
What is the formatted message returned if you use GetLastError() and FormatMessage() when the button fails to be created?
Invader X
Invader''s Realm
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement