• Member Avatar for cambalinho
    cambalinho

    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; …
  • Member Avatar for cambalinho
    cambalinho

    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?
  • Member Avatar for cambalinho
    cambalinho

    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
  • Member Avatar for cambalinho
    cambalinho

    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; …
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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. …
  • Member Avatar for cambalinho
    cambalinho

    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) :(
  • Member Avatar for cambalinho
    cambalinho

    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; …
  • Member Avatar for cambalinho
    cambalinho

    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; …
  • Member Avatar for cambalinho
    cambalinho

    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
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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
  • Member Avatar for cambalinho
    cambalinho

    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) …
  • Member Avatar for cambalinho
    cambalinho

    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) …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some advertisement are showed above the window code :(

    thanks i. and continue with nice work ;)
  • Member Avatar for cambalinho
    cambalinho

    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
  • Member Avatar for cambalinho
    cambalinho

    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
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in why handle invalid with SetTimer()?

    HWND WindowMain=GetDesktopWindow();
  • Member Avatar for cambalinho
    cambalinho

    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?
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in why handle invalid with SetTimer()?

    for child controls get the WM_CREATE message ;) or isn't needed?
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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; …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - how put the static transparent?

    how can i avoid the flicker?
  • Member Avatar for cambalinho
    cambalinho

    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)
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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
  • Member Avatar for cambalinho
    cambalinho

    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 ;)
  • Member Avatar for cambalinho
    cambalinho

    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.
  • Member Avatar for cambalinho
    cambalinho

    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: …
  • Member Avatar for cambalinho
    cambalinho

    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: …
  • Member Avatar for cambalinho
    cambalinho

    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: …
  • Member Avatar for cambalinho
    cambalinho

    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; …
  • Member Avatar for cambalinho
    cambalinho

    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; …
  • Member Avatar for cambalinho
    cambalinho

    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) …
  • Member Avatar for cambalinho
    cambalinho

    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..
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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) …
  • Member Avatar for cambalinho
    cambalinho

    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) …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in how overload != and == operators?

    thanks for all to all
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in how overload != and == operators?

    let me ask: why, sometimes, we use '*' and othertimes don't with 'this'?
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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 …
  • Member Avatar for cambalinho
    cambalinho

    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.