-
Replied To a Post in how use my class on function parameter?
heress the class otimizated: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; bool isimgused=false; bool isGDIPLUSIniciated=false; int imageheight=0; int imageweight=0; int framecount=0; … -
Replied To a Post in how use my class on function parameter?
sorry david... i'm confused. i'm destroying them on class destructor, right? -
Replied To a Post in some advertisement are showed above the window code :(
dani: same happens with the little chat window.. if you need, i can show a print screen. thanks for all -
Replied To a Post in how use my class on function parameter?
finally i fix it, now i use the new keyword and i can delete: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; … -
Gave Reputation to StuXYZ in how use my class on function parameter?
First of all I don't think I can tell you what is wrong to fix your current bug.. but here are a few thoughts, and I think we need to … -
Gave Reputation to triumphost in how use my class on function parameter?
You're invoking the copy assignment operator on a half initialised class. You've never initialised some of the variables in the other constructors that you have. By default they would be … -
Replied To a Post in how use my class on function parameter?
triumphost: if so.. why i get the HDC result correct? StuXYZ: thanks for all. it's fixed now, but i want avoid the 'const' and the '&' on Picture() function header. … -
Replied To a Post in how use my class on function parameter?
- so, using my new class's, must add 'const' and adress operator? - thanks for that error(pixels). but i get memory errors(when i execute the program) :( -
Created how use my class on function parameter?
heres my image class: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; bool isimgused=false; int imageheight=0; int imageweight=0; int framecount=0; int intSelectFrame=0; … -
Began Watching how use my class on function parameter?
heres my image class: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; bool isimgused=false; int imageheight=0; int imageweight=0; int framecount=0; int intSelectFrame=0; … -
Replied To a Post in [win32] - how put the static transparent?
i avoid some flicker, but not all: RedrawWindow(hwnd,&d,nullptr,RDW_UPDATENOW); i can't use the WS_CLIPCHILDREEN on parent, or the RedrawWindow() don't clean the control. but i accept sugestions -
Replied To a Post in [WIN32 and GDI and GDIPLUS] - why the button draw size is to big?
the problem was not the button, but the label. heres how i get the control size: //getting the text rectangle size RECT textrect={0}; DrawText (GetDC(hwnd),strCaption.c_str(),strCaption.size(),&textrect,DT_CALCRECT); //testing the image size //i … -
Marked Solved Status for why handle invalid with SetTimer()?
when the form is activated: case WM_ACTIVATE: { if (wParam==WA_INACTIVE) { SetWindowText(inst->hwnd,"unactivated"); FormActivated = NULL; } else { SetWindowText(inst->hwnd,"activated"); FormActivated = inst->hwnd; } return 0; } break; when i create … -
Replied To a Post in some advertisement are showed above the window code :(
i have seen that the problem is fixed. thanks for all. realy.. thanks -
Created win32 - how testing pixels of the WS_TRANSPARENT control?
the control have the WS_TRANSPARENT style. and: case WM_ERASEBKGND: { return TRUE; } break; case WM_CTLCOLORSTATIC: { return (LRESULT)GetStockObject(NULL_BRUSH); } break; case WM_DRAWITEM: { DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam; image imglabel(test->rcItem.right-test->rcItem.left,test->rcItem.bottom-test->rcItem.top); if(inst->blnTransparent!=true) … -
Began Watching win32 - how testing pixels of the WS_TRANSPARENT control?
the control have the WS_TRANSPARENT style. and: case WM_ERASEBKGND: { return TRUE; } break; case WM_CTLCOLORSTATIC: { return (LRESULT)GetStockObject(NULL_BRUSH); } break; case WM_DRAWITEM: { DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam; image imglabel(test->rcItem.right-test->rcItem.left,test->rcItem.bottom-test->rcItem.top); if(inst->blnTransparent!=true) … -
Replied To a Post in some advertisement are showed above the window code :(
thanks i. and continue with nice work ;) -
Created some advertisement are showed above the window code :(
i have advertisement problem. please see these image: https://onedrive.live.com/?cid=C3EF456E15C8DEB6&id=C3EF456E15C8DEB6!1268&v=3 how can i write if the advertisements are on front of little code window? thanks for all -
Began Watching some advertisement are showed above the window code :(
i have advertisement problem. please see these image: https://onedrive.live.com/?cid=C3EF456E15C8DEB6&id=C3EF456E15C8DEB6!1268&v=3 how can i write if the advertisements are on front of little code window? thanks for all -
Replied To a Post in why handle invalid with SetTimer()?
HWND WindowMain=GetDesktopWindow(); -
Replied To a Post in why handle invalid with SetTimer()?
i found the problem: case WM_PAINT: { return 0; } break; how these return value on WM_PAINT message can 'stop' the timer? -
Replied To a Post in why handle invalid with SetTimer()?
confused: if i minimizate the form, why the timer is working? (i know these, because after restaure the form, the image is changed) seems that i must give up on … -
Replied To a Post in why handle invalid with SetTimer()?
for child controls get the WM_CREATE message ;) or isn't needed? -
Created why handle invalid with SetTimer()?
when the form is activated: case WM_ACTIVATE: { if (wParam==WA_INACTIVE) { SetWindowText(inst->hwnd,"unactivated"); FormActivated = NULL; } else { SetWindowText(inst->hwnd,"activated"); FormActivated = inst->hwnd; } return 0; } break; when i create … -
Began Watching why handle invalid with SetTimer()?
when the form is activated: case WM_ACTIVATE: { if (wParam==WA_INACTIVE) { SetWindowText(inst->hwnd,"unactivated"); FormActivated = NULL; } else { SetWindowText(inst->hwnd,"activated"); FormActivated = inst->hwnd; } return 0; } break; when i create … -
Replied To a Post in [win32] - how put the static transparent?
i can use my image for Double Buffering easy. and only, in the end, i change the new image: //the animation timer: animation.timerprocedure=[this]() { static int a; a=a+1; if(a==imgtest.FramesCount) a=0; … -
Replied To a Post in [win32] - how put the static transparent?
how can i avoid the flicker? -
Replied To a Post in [win32] - how put the static transparent?
now works fine..thanks for all ;) RECT d; GetClientRect(hwnd,&d); RedrawWindow(hwnd,&d,nullptr,RDW_ERASE); triumphost: please can you tell me the diference between that 4 functions? (include the TRUE\FALSE of the Invalidate) -
Replied To a Post in [win32] - how put the static transparent?
i did that triumphost. but now i know why isn't working. the STATIC control is like a draw text, on form\window paint message. so i will create another control, like … -
Replied To a Post in [win32] - how put the static transparent?
i'm sorry.. what code is that? i'm in right sub-forum, i think -
Replied To a Post in [win32] - how put the static transparent?
yah. now i know the STATIC control it's drawed to parent window. so using the same way of the window creation, i can create my own label ;) -
Replied To a Post in [win32] - how put the static transparent?
that image is an animation. and the images are showed 1 above other. the correct is clean the last image and show the newone. -
Edited [win32] - how put the static transparent?
finally i have the static control transparent: //creating the form: hwnd = CreateWindowEx(0, classname, strCaption.c_str(),WS_OVERLAPPEDWINDOW | WS_TABSTOP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, mod, this); //sending a message for subclassing: … -
Created [win32] - how put the static transparent?
finally i have the static control transparent: //creating the form: hwnd = CreateWindowEx(0, classname, strCaption.c_str(),WS_OVERLAPPEDWINDOW | WS_TABSTOP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, mod, this); //sending a message for subclassing: … -
Began Watching [win32] - how put the static transparent?
finally i have the static control transparent: //creating the form: hwnd = CreateWindowEx(0, classname, strCaption.c_str(),WS_OVERLAPPEDWINDOW | WS_TABSTOP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, mod, this); //sending a message for subclassing: … -
Created [WIN32 and GDI and GDIPLUS] - why the button draw size is to big?
heres my image class: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; bool isimgused=false; int imageheight=0; int imageweight=0; int framecount=0; int intSelectFrame=0; … -
Began Watching [WIN32 and GDI and GDIPLUS] - why the button draw size is to big?
heres my image class: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; bool isimgused=false; int imageheight=0; int imageweight=0; int framecount=0; int intSelectFrame=0; … -
Marked Solved Status for [win32] - about RegisterHotKey()
the RegisterHotKey() is limited? everytime that i create a button control the RegisterHotKey() id isn't the same. //on constructor: ++ButtonCount; altmessage=ButtonCount; now the hotkey message: case WM_HOTKEY: { if (wParam==inst->altmessage) … -
Gave Reputation to triumphost in [win32] - about RegisterHotKey()
Why are you unregistering and registering the hotkey everytime the button is drawn? This looks like an owner drawn button but the question stands.. -
Replied To a Post in [win32] - about RegisterHotKey()
even so my problem was my own function for get the letter(from button caption). i was doing several errors without notice. heres my function: char GettingAltKey(string text) { char altkey=-1;//defauld … -
Created [win32] - about RegisterHotKey()
the RegisterHotKey() is limited? everytime that i create a button control the RegisterHotKey() id isn't the same. //on constructor: ++ButtonCount; altmessage=ButtonCount; now the hotkey message: case WM_HOTKEY: { if (wParam==inst->altmessage) … -
Began Watching [win32] - about RegisterHotKey()
the RegisterHotKey() is limited? everytime that i create a button control the RegisterHotKey() id isn't the same. //on constructor: ++ButtonCount; altmessage=ButtonCount; now the hotkey message: case WM_HOTKEY: { if (wParam==inst->altmessage) … -
Replied To a Post in how overload != and == operators?
thanks for all to all -
Marked Solved Status for how overload != and == operators?
i'm trying overload the != and == operators, but i'm getting several errors :( bool operator==(const image &other) const { if(other.btBitmap==*this->btBitmap) return true; else return false; } bool operator!=(const image … -
Gave Reputation to NathanOliver in how overload != and == operators?
`haveimage()` returns true or false so if `haveimage()` returns true then `if(inst->imgtest.haveimage())` becomes `if(true)` and the body of the if statement is executed. If it were false then `if(inst->imgtest.haveimage())` becomes … -
Replied To a Post in how overload != and == operators?
let me ask: why, sometimes, we use '*' and othertimes don't with 'this'? -
Replied To a Post in how overload != and == operators?
honestly that types of if's are confused to me: if(inst->imgtest.haveimage())//same: if(inst->imgtest.haveimage()==true) //and if(!inst->imgtest.haveimage())//same: if(inst->imgtest.haveimage()==false) //correct me if i'm wrong ;) yes i use C++ 11 type with compiler... my all … -
Gave Reputation to NathanOliver in how overload != and == operators?
You wouldn't have to write if(inst->imgtest.haveimage()==true) That could be expressed as if(inst->imgtest.haveimage()) When using an IDE that has auto-complete it is even faster to write. I also want to stress … -
Gave Reputation to mike_2000_17 in how overload != and == operators?
You have a superfluous `*` character on line 3. This should work: bool operator==(const image &other) const { return (other.btBitmap == this->btBitmap) } bool operator!=(const image &other) const { return … -
Gave Reputation to NathanOliver in how overload != and == operators?
Is `imgtest` a pointer? I am guessing it is not because of the error : "ambiguous overload for 'operator!=' (operand types are 'image' and 'int')" If a type is not …
The End.