• Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - getting HBITMAP from HDC and memory leaks

    now works without memory leaks. thanks for all
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - getting HBITMAP from HDC and memory leaks

    now i did: ~image() { Gdiplus::GdiplusShutdown(m_gdiplusToken); //delete graphic;//memory leak too //delete img; /*if(btBitmap!=NULL ||obj!=NULL) { SelectObject(hdcimage, obj); //DeleteObject(btBitmap);//don't show me the image }*/ DeleteDC(hdcimage); } and no memory leak. unless …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - getting HBITMAP from HDC and memory leaks

    i did all the changes, but i continue with problems: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap; Gdiplus::Graphics *graphic; Image *img; int imageheight=0; …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - getting HBITMAP from HDC and memory leaks

    finally works fine: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HBITMAP btBimap; Gdiplus::Graphics *graphic; Image *img; int imageheight=0; int imageweight=0; int framecount=0; int intSelectFrame=0; int framedelay=0; string …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - getting HBITMAP from HDC and memory leaks

    triumphost the image isn't showed on menu :( //on image class operator HBITMAP() { HBITMAP hbitmap=reinterpret_cast<HBITMAP>(GetCurrentObject(hdcimage, OBJ_BITMAP)); return hbitmap; } //on menu class void bitmap(image imgImage) { //HBITMAP bitimage = …
  • Member Avatar for cambalinho
    cambalinho

    Created [win32] - getting HBITMAP from HDC and memory leaks

    when do: operator HBITMAP() { HBITMAP hbitmap=CreateBitmap(imageweight,imageheight,1,32,NULL);//create the bitmap with icon size SelectObject(hdcimage, hbitmap);//add the bitmap to memory DC MessageBox(NULL,to_string(GetLastError()).c_str(),"error",MB_OK); return hbitmap; } the hdcimage is copyied to hbitmap, right?
  • Member Avatar for cambalinho
    cambalinho

    Began Watching [win32] - getting HBITMAP from HDC and memory leaks

    when do: operator HBITMAP() { HBITMAP hbitmap=CreateBitmap(imageweight,imageheight,1,32,NULL);//create the bitmap with icon size SelectObject(hdcimage, hbitmap);//add the bitmap to memory DC MessageBox(NULL,to_string(GetLastError()).c_str(),"error",MB_OK); return hbitmap; } the hdcimage is copyied to hbitmap, right?
  • Member Avatar for cambalinho
    cambalinho

    Created [win32] - how show popup menus?

    i have these code for show popupmenus: case WM_USER + 1: { if(lParam==WM_RBUTTONUP) { POINT pCursor; GetCursorPos(&pCursor); HMENU test=GetSubMenu(GetMenu(HandleWindow),0); SetForegroundWindow(HandleWindow); TrackPopupMenu(test, TPM_LEFTBUTTON | TPM_RIGHTALIGN, pCursor.x, pCursor.y, 0, HandleWindow, NULL); PostMessage(HandleWindow, …
  • Member Avatar for cambalinho
    cambalinho

    Began Watching [win32] - how show popup menus?

    i have these code for show popupmenus: case WM_USER + 1: { if(lParam==WM_RBUTTONUP) { POINT pCursor; GetCursorPos(&pCursor); HMENU test=GetSubMenu(GetMenu(HandleWindow),0); SetForegroundWindow(HandleWindow); TrackPopupMenu(test, TPM_LEFTBUTTON | TPM_RIGHTALIGN, pCursor.x, pCursor.y, 0, HandleWindow, NULL); PostMessage(HandleWindow, …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to Duoas in [win32] - how build menu shortcuts?

    No. All (normal) messages go to a window event handler. The functions you write to handle events can, of course, be as window agnostic as you like.
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - how build menu shortcuts?

    now it's working nice ;) i did a diferent tool for make menu shortcuts and works fine: struct MenuShortCuts { //inicializate structure values MenuShortCuts() : MenuPointer(NULL), key(-1), alt(false), control(false), shift(false) …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - how build menu shortcuts?

    i need ask 1 thing: //Message Loop WPARAM MessageLoop() { MSG msgEvents; while(GetMessage(&msgEvents, NULL, 0, 0) > 0) { if(IsChild(GetForegroundWindow(),msgEvents.hwnd)==TRUE || GetForegroundWindow()==msgEvents.hwnd) { if(IsDialogMessage(GetForegroundWindow(), &msgEvents) == TRUE) { TranslateMessage(&msgEvents); DispatchMessage(&msgEvents); …
  • Member Avatar for cambalinho
    cambalinho

    Marked Solved Status for how do the uppercase and lowercase?

    i did these function for uppercase: string Upper(string text) { string result; result.resize(text.size()); for(int i=0; i<text.size(); i++) { if(text[i]>96 && text[i]<123) result[i]= text[i]-32; result[i]=text[i]; } return result; } but i'm …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in how do the uppercase and lowercase?

    heres the 2 functions rebuilded: string UpperCase (const string& in) { string out(in); for (size_t i = 0; i < in.size (); ++i) { out[i] = toupper(out[i]); } return out; …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to Maritimo in how do the uppercase and lowercase?

    I recomend you to use the function `int toupper( int ch )` defined in header `<cctype>`
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to L7Sqr in how do the uppercase and lowercase?

    You may want to look into `<cctype>` which provides facilities for this type of thing. For example: #include <string> #include <cctype> std::string make_upper (const std::string& in) { std::string out(in); for …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to sneekula in how do the uppercase and lowercase?

    Something like that: // removes the third bit, simple way to create upper case char char toupper(char ch) { return ch & 0xDF; } Sorry doesn't handle numbers etc.
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to sneekula in how do the uppercase and lowercase?

    @cambalinho you are mixing char and int types, do the proper casts and your approach will work: // str_Upper.cpp // convert a string to all upper case #include <iostream> #include …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to L7Sqr in how do the uppercase and lowercase?

    @sneekula: why use an approach that forces limits on the *input*? `toupper` is designed specifically for this purpose and has a corresponding `towupper` for wide characters. Byte ranges and bit …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to NathanOliver in how do the uppercase and lowercase?

    @cambalinho The reason you are gettting that error is `std::string.c_str()` returns a `char*` to the c-string the string contains. A `char` and a `char*` are not the same thing. If …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to vegaseat in how do the uppercase and lowercase?

    @L7Sqr In all fairness SneeKula answered the original question. Sometimes it is fun to experiment a little to get to know the language better. Yes, I would rather use the …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to NathanOliver in how do the uppercase and lowercase?

    I would think line 8 needs to be: TableMenuShortCuts[TableMenuShortCuts.size()-1].key=(c[c.size()-1])[0];
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - how build menu shortcuts?

    by several reasons i'm doing my own table accelerator code ;) thanks for all (after finish, i will show the code)
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in how do the uppercase and lowercase?

    i'm sorry to both, but i continue with problems :( string Ustrcaption=UpperCase(strCaption); String b=Ustrcaption;//is like the normal string, but have the separewordssymbols() and more functions vector<string> c; c=b.separewordssymbols();//tested and the …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in how do the uppercase and lowercase?

    anotherthing: when i do from string to char: i get an error: 'cast from 'const char*' to 'char' loses precision [-fpermissive]|' what you can advice? TableMenuShortCuts[TableMenuShortCuts.size()-1].key=(char)j.c_str(); key structure member is …
  • Member Avatar for cambalinho
    cambalinho

    Created how do the uppercase and lowercase?

    i did these function for uppercase: string Upper(string text) { string result; result.resize(text.size()); for(int i=0; i<text.size(); i++) { if(text[i]>96 && text[i]<123) result[i]= text[i]-32; result[i]=text[i]; } return result; } but i'm …
  • Member Avatar for cambalinho
    cambalinho

    Began Watching how do the uppercase and lowercase?

    i did these function for uppercase: string Upper(string text) { string result; result.resize(text.size()); for(int i=0; i<text.size(); i++) { if(text[i]>96 && text[i]<123) result[i]= text[i]-32; result[i]=text[i]; } return result; } but i'm …
  • Member Avatar for cambalinho
    cambalinho

    Created [win32] - WM_KEYUP\WM_KEYDOWN: how test if was alt\control\shift keys?

    using the WM_KEYUP, can i see if the shift\control\alt keys was uped too?
  • Member Avatar for cambalinho
    cambalinho

    Began Watching [win32] - WM_KEYUP\WM_KEYDOWN: how test if was alt\control\shift keys?

    using the WM_KEYUP, can i see if the shift\control\alt keys was uped too?
  • Member Avatar for cambalinho
    cambalinho

    Created [win32] - how build menu shortcuts?

    ok. for use menu shorcuts i must create a table accelerator and change my message loop. but can i process the table accelerator without use the HWND?
  • Member Avatar for cambalinho
    cambalinho

    Began Watching [win32] - how build menu shortcuts?

    ok. for use menu shorcuts i must create a table accelerator and change my message loop. but can i process the table accelerator without use the HWND?
  • Member Avatar for cambalinho
    cambalinho

    Marked Solved Status for [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i'm using the HiliteMenuItem() for test if the mouse is above the menu item: int i=0; for(i=0; i<GetMenuItemCount(menuhandle); i++) { if(HiliteMenuItem(HandleWindow,menuhandle,i,MF_BYPOSITION) == true) { menuposition=(UINT)i; break; } } but i …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to triumphost in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    Here try this.. It's very hard to explain so hopefully you can understand it by seeing the code: [Menu-Class CodeBlocks Example](https://mega.co.nz/#!FRsDjSia!jTTR2yUemo0px1BQ68sTXlIYKd0qcRqFV9Eu2-o574s) It works like this: When you create a menu, …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    finally i correct that: //when the mouse move, enter, leave and leave the menu case WM_MENUSELECT: { static int Last_Menu_ID = -1; if(((HIWORD(wParam) & MF_HILITE) || (HIWORD(wParam) & MF_MOUSESELECT)) && …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i think that i miss undertood your code: case WM_MENUSELECT: { static int Last_Menu_ID = -1; if(((HIWORD(wParam) & MF_HILITE) || (HIWORD(wParam) & MF_MOUSESELECT)) && GetMenuState(menuhandle,LOWORD(wParam),MF_BYCOMMAND)!=-1) { //Mouse Enter Last_Menu_ID = …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    now i'm trying do the mouse enter and mouse exit commands: case WM_MENUSELECT: { if(menuitem!=-1)//call the mouse exit { MENUITEMINFO menuInfo; menuInfo.cbSize = sizeof(MENUITEMINFO); menuInfo.fMask=MIIM_DATA; GetMenuItemInfo((HMENU)lParam,menuitem, FALSE, &menuInfo ); Menu …
  • Member Avatar for cambalinho
    cambalinho

    Revoked Solved Status for [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i'm using the HiliteMenuItem() for test if the mouse is above the menu item: int i=0; for(i=0; i<GetMenuItemCount(menuhandle); i++) { if(HiliteMenuItem(HandleWindow,menuhandle,i,MF_BYPOSITION) == true) { menuposition=(UINT)i; break; } } but i …
  • Member Avatar for cambalinho
    cambalinho

    Marked Solved Status for [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i'm using the HiliteMenuItem() for test if the mouse is above the menu item: int i=0; for(i=0; i<GetMenuItemCount(menuhandle); i++) { if(HiliteMenuItem(HandleWindow,menuhandle,i,MF_BYPOSITION) == true) { menuposition=(UINT)i; break; } } but i …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to triumphost in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    Works fine as far as I can tell.. You need to give more details or show code. #if defined(UNICODE) && !defined(_UNICODE) #define _UNICODE #elif defined(_UNICODE) && !defined(UNICODE) #define UNICODE #endif …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    thanks for that you give me an idea ;) case WM_SYSCOMMAND: { if (menuhandle!=NULL && GetMenuState(menuhandle,wParam,MF_BYCOMMAND)!=-1 ) { MENUITEMINFO menuInfo; menuInfo.cbSize = sizeof(MENUITEMINFO); menuInfo.fMask=MIIM_DATA; GetMenuItemInfo(menuhandle,(UINT) wParam, FALSE, &menuInfo ); Menu …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    thanks your code is nice and i understand it ;) let me ask 1 thing: using WM_SYSCOMMAND what is the wParam that tell me that the any menu was clicked? …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    the system control menu, uses the WM_SYSCOMMAND message. the WM_MENUSELECT and WM_INITMENUPOPUP messages are global i think. using the WM_SYSCOMMAND and return: return DefWindowProc(HandleWindow, msg, wParam, lParam); if i open …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    continue with WM_SYSCOMMAND: how can i test if the menu item was clicked? (if i open an close the control system menu(without click on menu item), i will get errors)
  • Member Avatar for cambalinho
    cambalinho

    Revoked Solved Status for [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i'm using the HiliteMenuItem() for test if the mouse is above the menu item: int i=0; for(i=0; i<GetMenuItemCount(menuhandle); i++) { if(HiliteMenuItem(HandleWindow,menuhandle,i,MF_BYPOSITION) == true) { menuposition=(UINT)i; break; } } but i …
  • Member Avatar for cambalinho
    cambalinho

    Marked Solved Status for [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i'm using the HiliteMenuItem() for test if the mouse is above the menu item: int i=0; for(i=0; i<GetMenuItemCount(menuhandle); i++) { if(HiliteMenuItem(HandleWindow,menuhandle,i,MF_BYPOSITION) == true) { menuposition=(UINT)i; break; } } but i …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    the wParam, on WM_SYSCOMMAND, give me the menu item ID ;) thanks for all
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i'm trying several ways without sucess :( case WM_INITMENUPOPUP: { menuhandle=(HMENU)wParam; return 0; } break; case WM_SYSCOMMAND: { if(wParam & SC_MOUSEMENU) { MENUITEMINFO menuInfo; menuInfo.cbSize = sizeof(MENUITEMINFO); menuInfo.fMask=MIIM_DATA; int xPos …
  • Member Avatar for cambalinho
    cambalinho

    Created [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i'm using the HiliteMenuItem() for test if the mouse is above the menu item: int i=0; for(i=0; i<GetMenuItemCount(menuhandle); i++) { if(HiliteMenuItem(HandleWindow,menuhandle,i,MF_BYPOSITION) == true) { menuposition=(UINT)i; break; } } but i …
  • Member Avatar for cambalinho
    cambalinho

    Began Watching [win32] - about HiliteMenuItem() funtion and menu mouse move selection

    i'm using the HiliteMenuItem() for test if the mouse is above the menu item: int i=0; for(i=0; i<GetMenuItemCount(menuhandle); i++) { if(HiliteMenuItem(HandleWindow,menuhandle,i,MF_BYPOSITION) == true) { menuposition=(UINT)i; break; } } but i …
  • Member Avatar for cambalinho
    cambalinho

    Marked Solved Status for having downloads and some updates problems :(

    i'm haviing problems with my windows 7. i do some downloads and they stop before been finished :( even the microsoft essencials isn't updated :( what is going on with …

The End.