Category : winapi

I have an application that catalogs image files on my computer. In CWinApp::InitInstance, I initialize Gdiplus using the following: GdiplusStartupInput gdiplusStartupInput; GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL); also, in the init function of my library class, I do the same. Finally, because I spawn a separate thread to perform this task, I initialize GDI+ again at the beginning ..

Read more

I was doing some screen capture tests and I decided to put GetFrontBufferData in a while, at first it works fine, 60 fps but after a few seconds the program was opened it drops to 30 fps and the windows interface gets slow. I did some research and noticed that when I open my program ..

Read more

I have a python program scheduled in task scheduler which calls another python program after a specific condition and print newly created Excel file which is also created by the same python code in previous lines. After generating the Excel file on a daily basis this program should print the Excel file. Although it does ..

Read more

Here’s the tutorial: https://www.youtube.com/watch?v=8OK8_tHeCIA When I get to the part about actually rendering the output to the console screen at around 12 : 25 in the video when he checks his output mine actually looks like this: https://imgur.com/w1JmnrX Even if I copy and paste his code, my output is still displayed like this. What’s going ..

Read more

I’m storing some HBITMAPS in memory to speed up and reduce CPU usage in some animations, however they are using way too much RAM. What can I try to compress/reduce their size while in memory? Gdiplus::Color Color{ 255, 255, 255 }; hBitmap = NULL; Gdiplus::Bitmap* bitmap = Gdiplus::Bitmap::FromFile(L"home.png", false); if (bitmap) { bitmap->GetHBITMAP(Color, &hBitmap); delete ..

Read more

I can load a hbitmap into a hdc like this: Gdiplus::Color Color{ 255, 255, 255 }; hBitmap = NULL; Gdiplus::Bitmap* bitmap = Gdiplus::Bitmap::FromFile(L"home.png", false); if (bitmap) { bitmap->GetHBITMAP(Color, &hBitmap); delete bitmap; } BITMAP bm; GetObject(hBitmap, sizeof(bm), &bm); HDC hDCMem = CreateCompatibleDC(NULL); HBITMAP hBitmapOld = (HBITMAP)SelectObject(hDCMem, hBitmap); How could I do the reverse, getting back a ..

Read more