-
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
i did these way: static LRESULT CALLBACK WndProcForm(HWND HandleWindow, UINT msg, WPARAM wParam, LPARAM lParam) { static POINT PreviousLocation, Location; static bool Tracking = false; static MouseButtons MBButtons; static bool … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
now works fine... thanks for all ;) i need 1 advice... just see these code: #include "cambalinho.h" form a;//these line creates and show the form int WinMain() { //here i … -
Gave Reputation to triumphost in [win32] - super subclass: how connect the form to window procedure
Here: http://pastie.org/private/c1qqrhycdpa1dk6flgonw Same code you have but working. Only 1 line changed. Your error was because `WM_CREATE` is called before the `default` statement. If you initialise `inst` before you enter … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
i need show you something... but now i'm getting, again errors and i don't undertstand why :( i just change the event create from static to normal variable and i … -
Gave Reputation to triumphost in [win32] - super subclass: how connect the form to window procedure
@Cambalinho: What you did wrong was to not make the changes I told you to make earlier. Might have missed it by accident. You needed to have: `if (inst->Create != … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
triumphost: sorry... but i was trying :( thanks for correct me that ;) i have more 1 question: these way can be used for child controls(for getting the pointer)? i … -
Gave Reputation to triumphost in [win32] - super subclass: how connect the form to window procedure
Here is your code.. I modified it to work.. The window will show for 5 seconds and then disappear. http://pastie.org/private/8aspaldrbai204h8yvpew And these are the changes made: http://www.diffchecker.com/lm9l4m3y -
Gave Reputation to triumphost in [win32] - super subclass: how connect the form to window procedure
@Cambalinho.. Your errors were: case WM_NCCREATE: { CREATESTRUCT *p = (CREATESTRUCT *)lParam; inst = (form *)p->lpCreateParams; SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)form); //error.. hwnd should be: HandleWindow parameter. (LONG_PTR)form should be: (LONG_PTR)inst.. //The … -
Gave Reputation to triumphost in [win32] - super subclass: how connect the form to window procedure
Bad code here? SetProp(hwnd, formpropname, (HANDLE)FormClass.lpfnWndProc); hwnd = CreateWindowEx(0, classname, "The title of my window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, parent, NULL, mod, (LPVOID) this); HWND isn't assigned when you … -
Gave Reputation to Ancient Dragon in [win32] - super subclass: how connect the form to window procedure
use your debugger and put a breakpoint on WM_CREATE. Since the window hasn't been created yet there can be no message box to show you. -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
triumphost: thanks you very much, but i continue confuse: what i did wrong with my code? (i'm trying see the diference code) -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
see these inside of window procedure: form *inst = (form *)GetWindowLongPtr(HandleWindow, GWLP_USERDATA);//give me NULL(because the message box is showed), but no errors if (inst==NULL) MessageBox(NULL,"error", "error",MB_OK); if i take of … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
i'm getting problems, with your code, for get the pointer :( i don't understand.... what i'm doing wrong? tell me something for learn more please -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
that main message loop is used in these way: #include "cambalinho.h" HWND WindowMain=NULL;//these is inside of cambalinho.h //and it's value is added when the form is created #define WinMain() WINAPI … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
sorry... i don't get errors, on code, but when i execute, i can't see the form and after some time i see the output message: "Process terminated with status -1073741819" … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
heres my entire class: http://codepad.org/SrOIpP6t my objective is trying get the form instance pointer in WndProcForm() callback function. i use some static variables, because the WndProcForm() callback function is static(class … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
triumphost: thanks... seen your code, i did: void setParent(HWND parent=GetDesktopWindow()) { WNDCLASSEX FormClass; char classname[]="form"; HINSTANCE mod = (HINSTANCE)GetModuleHandle(NULL); FormClass.cbSize = sizeof(WNDCLASSEX); FormClass.style = 0; FormClass.lpfnWndProc = WndProcForm; FormClass.cbClsExtra = … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
theres another way.. i have done with another code, but don't works with these code :( let me ask in other way: when we use CreateWindowEx() function with 'this' class … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
you have right. the problem was not the window procedure(i did new tests)... but the order of code ;) i fix that in constructor and now my 'event' is activated … -
Replied To a Post in [win32] - super subclass: how connect the form to window procedure
in these sample, i only have 1 form. see the setParent(): form() { ++FormCount; strCaption=strCaption + to_string(FormCount); setParent(HWND_DESKTOP); } void setParent(HWND parent=GetDesktopWindow()) { WNDCLASSEX FormClass; char classname[]="form"; HINSTANCE mod = … -
Created [win32] - super subclass: how connect the form to window procedure
i'm creating the form class. the form us showed and the window procedure works. the problem is that some messages(like WM_CREATE) aren't working. so how can i connect, correctly the … -
Began Watching [win32] - super subclass: how connect the form to window procedure
i'm creating the form class. the form us showed and the window procedure works. the problem is that some messages(like WM_CREATE) aren't working. so how can i connect, correctly the … -
Created can i declare functions private in header files?
can i declare functions private in header files? imagine that you use a function declared outside the class and you only want be used only by that class... how can … -
Began Watching can i declare functions private in header files?
can i declare functions private in header files? imagine that you use a function declared outside the class and you only want be used only by that class... how can … -
Replied To a Post in [win32] - getting child controls from it's parent
SalmiSoft: you have right... thanks heres the class updated: BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam ); class ChildControls { private: vector<HWND> childcontrols; HWND windowparent; friend BOOL EnumChildProc( HWND hwnd, … -
Gave Reputation to SalmiSoft in [win32] - getting child controls from it's parent
Sorry, I don't have a C++ development environment installed to check this, but shouldn't you clear the childcontrols vector before you call EnumChildWindows? Also, do you need to maintain your … -
Gave Reputation to SalmiSoft in [win32] - getting child controls from it's parent
> EnumChildWindows() isn't correct with 3rd and 4th arguments :( I find this comment a little confusing because EnumChildWindows takes only 3 parameters, not 4. The first parameter in your … -
Replied To a Post in [win32] - getting child controls from it's parent
my problem was with HWND parent ;) let me ask more: 1 - why i can't do these with class(when i close it)? }ChildControls; i need avoid instances of that … -
Replied To a Post in [win32] - getting child controls from it's parent
i have that function ouside of class, but i don't get correct results :( BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam ); class ChildControls { private: vector<HWND> childcontrols; UINT childcontrolsindex; … -
Created [win32] - getting child controls from it's parent
i'm trying create a class for getting the child controls from it's parent, but without sucess :( class ChildControls { private: vector<HWND> childcontrols; UINT childcontrolsindex; HWND windowparent; public: ChildControls(const HWND … -
Began Watching [win32] - getting child controls from it's parent
i'm trying create a class for getting the child controls from it's parent, but without sucess :( class ChildControls { private: vector<HWND> childcontrols; UINT childcontrolsindex; HWND windowparent; public: ChildControls(const HWND … -
Replied To a Post in [win32] - RegisterHotKey: can i do a new resgist?
seems that i found some problems... when i change the parent, i can lose somethings or the HWND is changed ;) that's why, when i try change the hot key, … -
Replied To a Post in [win32] - RegisterHotKey: can i do a new resgist?
i belive that you call it Acelerator Keys(alt key + letter key for activate the button(for exemple) click. that function help me make the simulation, but when the caption\text is … -
Created [win32] - RegisterHotKey: can i do a new resgist?
RegisterHotKey is for we use the combined keys and the WM_HOTKEY message. i use these function for use the alt combination... but i need ask: can i re-regist the combination … -
Began Watching [win32] - RegisterHotKey: can i do a new resgist?
RegisterHotKey is for we use the combined keys and the WM_HOTKEY message. i use these function for use the alt combination... but i need ask: can i re-regist the combination … -
Gave Reputation to nullptr in [win32] - how call the WM_DRAWITEM message?
That question has already been answered in your thread at MSDN. For an idea about drawing non themed buttons refer to http://blog.quppa.net/2012/02/12/drawing-non-themed-push-buttons-in-windows/ -
Marked Solved Status for [win32] - how call the WM_DRAWITEM message?
i'm trying call the WM_DRAWITEM message from WM_KEYUP message without sucess :( bool KeyPressed(int a) { if(GetAsyncKeyState(a)) { return true; } else { return false; } } //in WM_KEYUP message … -
Replied To a Post in [win32] - how call the WM_DRAWITEM message?
thank you. now i can draw the windows 98 theme and windows xp theme and another drawed button... very cool... thanks for all -
Replied To a Post in [win32] - how call the WM_DRAWITEM message?
yes.. you have right... the SetWindowText() don't works with hButton when i use BS_OWNERDRAW style. for finish these topic, let me ask anotherthing: when i draw the button face(the WM_DRAWITEM … -
Replied To a Post in [win32] - how call the WM_DRAWITEM message?
heres the entire code. don't forget link the library: libuxtheme.a(i use the code blocks... see what libary is used with your IDE). #include <windows.h> #include <stdio.h> #include <string> #include <Uxtheme.h> … -
Replied To a Post in [win32] - how call the WM_DRAWITEM message?
thanks for all.. anotherthing: when we do a draw Button, why the WM_COMMAND message is ignored? -
Replied To a Post in [win32] - how call the WM_DRAWITEM message?
these code avoids the flickers, but i can't use it because can slow down the windows messages: InvalidateRect(hButton, NULL, false); // TRUE to erase the background Sleep(100); UpdateWindow(hButton); so what … -
Replied To a Post in [win32] - how call the WM_DRAWITEM message?
i love your code ;) but i get that function like a infinite loop, because of InvalidateRect() function. and i get flickers. -
Created [win32] - how call the WM_DRAWITEM message?
i'm trying call the WM_DRAWITEM message from WM_KEYUP message without sucess :( bool KeyPressed(int a) { if(GetAsyncKeyState(a)) { return true; } else { return false; } } //in WM_KEYUP message … -
Began Watching [win32] - how call the WM_DRAWITEM message?
i'm trying call the WM_DRAWITEM message from WM_KEYUP message without sucess :( bool KeyPressed(int a) { if(GetAsyncKeyState(a)) { return true; } else { return false; } } //in WM_KEYUP message … -
Marked Solved Status for [win32] - someone can explain to me these information with code?
i'm reading these page: http://msdn.microsoft.com/en-us/library/windows/desktop/bb775951%28v=vs.85%29.aspx but see the Remarks section: Remarks For illustrations of the principal button styles such as BS_CHECKBOX and BS_GROUPBOX, see Button Types. The appearance of text … -
Replied To a Post in [win32] - someone can explain to me these information with code?
thanks for all -
Gave Reputation to triumphost in [win32] - someone can explain to me these information with code?
This will work. You MUST have visual styles enabled in order to have an icon AND text at the same time.. Of course, you do not want to use the … -
Replied To a Post in [win32] - someone can explain to me these information with code?
thank you. now i need ask: 1 - can i change the icon position? 2 - can i use the windows 2000 button style and continue using the image? 3 … -
Replied To a Post in [win32] - how create a bitmap in memory?
but goind back to the question: what i'm doing wrong for create the Bitmap, in memory?
The End.