winapi

If i develop c++ win32 GUI in xp ,will i have problem to run in it deferent win os's

Hello all i need to develop win32 GUI in c++ (plain win32 windows.h thing ) , I'm developing it in xp os how much problem will i have to port it to vista and windows 7 ? ...

GetRawInputData vs GetAsyncKeyState()

Well, I'm trying to avoid using the deprecated DirectInput. But I need, at each "frame" or "iteration" of the game to snatch ALL KEY STATES so that I can act accordingly. For example, if the player is down on the VK_RIGHT key then he will move just a smidgen right on that frame. The problem with WM_INPUT messages is they can appear an...

How do I get if static window is clicked

Hell I have a static Window in my C++ program But it doesnt respond when I click hButton = CreateWindowEx(0, "static",NULL, WS_VISIBLE | WS_CHILD | BS_BITMAP, 10, 5, //Left, Top 200, 40, //Width, Height hwnd, (HMENU)ID_hButton, hInstance, NULL); It wont show the MessageBox when I click it. cas...

Changing background of text in edit control

can you change the background of text in area of edit control that would stay static? ...

Faster method for exporting embedded data

For some reasons, i'm using the method described here: http://geekswithblogs.net/TechTwaddle/archive/2009/10/16/how-to-embed-an-exe-inside-another-exe-as-a.aspx It starts off from the first byte of the embedded file and goes through 4.234.925 bytes one by one! It takes approximately 40 seconds to finish. Is there any other methods for ...

Shatter Glass desktop Win32 effect for windows?

I would like a win32 program that takes the desktop and acts like it is shattering glass and in the end would put the pieces back together is there way reference on Doing this kind of effect with C++? ...

How to get path of file dragged into Win32 app and delete it?

I have a program and when they drop files into it I want it to get the path show a messagebox "of the path" then delete it. Can anyone shed some light on how to do this? ...

[Win32] Copying string to clipboard, only one character written when pasted

I was basic some code off this code, also mentioned in my other question. That version forces the character type to char*, which breaks compilation on my unicode project. So I made the following tweaks: void SetClipboardText(CString & szData) { HGLOBAL h; LPTSTR arr; size_t bytes = (szData.GetLength()+1)*sizeof(TCHAR); ...

SetClassLong(hWnd, GCL_HICON, hIcon) cannot replace WinForms Form.Icon

I'd like to use a specific ICO file as my icon with a WinForms application. Since I want to be able to specify a small icon (16x16) for the title bar and a normal icon (32x32) when Alt-Tabbing, I cannot use the Form.Icon property which accepts a single System.Drawing.Icon object, which forces me to use either the low res icon, or the nor...

Form.TopMost works sometimes

It appears that the topmost property sometimes puts my application above all others, but throughout my testing it has been very weird in that sometimes it works and the window remains above all other (external application) windows, but sometimes it does nothing at all. I have even tried using the WS_EX_TOPMOST flag by setting it with the...

Extending mouse click event - C

Currently I am detecting the x and y position of a mouse click, storing it in a Point and displaying it through the message box. I want to be able to read if another keyboard key is being held down such as the Shift or Control button. Looking on MSDN I found the following information: wParam Indicates whether various virtual keys...

How do I call an executable from a C program (using winapi)?

CreateProcess() came up a few times searching google.... Is it OK to assume this is the safest and most efficient method? If so, I would like to use the output of the called process. How do I know it has completed before continuing on in the C program? Thanks. ...

Delphi to C++ GetModuleBase function conversion??

I'm no delphi wizard but I found this function on a board and I need it badly for C++, Is there somebody who knows Delphi and C++ well enough to convert it? function GetModuleBase(hProcID: Cardinal; lpModName: PChar):Cardinal; var hSnap: Cardinal; tm: TModuleEntry32; begin result := 0; hSnap := CreateToolHelp32Snapshot(TH32CS_SN...

C++ Win32, easiest way to show a window with a bitmap.

Hi, It's only for 'debugging' purposes, so I don't want to spend a lot of time with this, nor it is very important. The program exports the data as a png, jpg, svg, etc... -so it's not a big deal, though it could be good to see the image while it is being generated. Also, the program is going to be used in a Linux server; but I'll limit...

How do I use errorno and _get_errno?

Calling system() to run an external .exe and checking error code upon errors: #include <errno.h> #include <stdlib.h> function() { errno_t err; if( system(tailCmd) == -1) //if there is an error get errno { //Error calling tail.exe _get_errno( &err ); } } First two compile errors: ...

C++ Win32api, creating a dialog box without resource

Hi! I'm new to win32api programming. I would like to know how to create a dialog box within a non-gui program (without any resource created). I've seen some examples with that CreateIndirect function. Is it the best method? Any other way? Thanks! ...

Finding the version of an application from Python?

Basically i am trying to find out what version of ArcGIS the user currently has installed, i looked through the registry and couldn't find anything related to a version string. However i know it is stored, within the .exe. I've done a fair bit of googling, and can't find anything really worth it. I tried using the GetFileVersionInfo, a...

Program crash in x64, works fine in Win32

I'm working on an application which builds and runs fine in Win32. However, in x64, it builds but crashes on run. Looking at the code and narrowing down the problem, if I comment out the call to the below function, it runs with no problem. void vec3_copy (double* v1, const double* v2) { v1[0] = v2[0]; v1[1] = v2[1]; v1[2] = v2[2];...

not active popup window

Hi, I've created a popup window with SW_SHOWNA. The problem is when I move the main window behind the popup window the popup window stays at the same place. Is there any way to catch the click on the title bar (or other technique) of the main window behind the popup window and to close the popup window? thanks a lot! mike. ...

How do I ensure no re-entrant access to my main-STA COM server (C++)?

OK, I suspect I'm going to have difficulty even putting this in words since my understanding of COM and apartments isn't really up to the job ;-) I have a COM in-process server/component (C++) that wraps some legacy code. Due to the limitations of this legacy code I need to ensure that the methods of the COM component are: only called...