I'm starting on a Windows Mobile project (no .NET Compact Framework - just native code). Having been a Win32 programmer (managed and native) for many years, I probably have some "desktop-isms" built in my brain that just don't translate well to the mobile world.
Are there any tips you may want to share about typical pitfalls for someone...
i have a function like this:
BOOL WINAPI MyFunction(HDC hdc, LPCWSTR text, UINT cbCount){
char AnsiBuffer[255];
int written = WideCharToMultiByte(CP_ACP, 0, text, cbCount, AnsiBuffer , 0, NULL, NULL);
if(written > -1) AnsiBuffer[written] = '\0';
if(written>0){
ofstream myfile;
myfile.open ("C:\\example.txt", ios::app);
myfile.writ...
Im trying to change the thread priority in boost but im having no luck. Im getting a bad handle error (type 6) from the GetLastError function. I though native_handle() returned the handle for the thread?
Any one know how to do this?
void baseThread::applyPriority(uint8 priority)
{
#ifdef WIN32
if (!m_pThread)
return;
BOO...
Hi all,
Hopefully someone has an answer, and it's not TOO complex. I'm working on a C++ dll (no C# or .Net, fully static DLL).
Anyhow, its woring on buildin monochrome bitmaps. I have all of it working EXCEPT the resolution. I get the Device Context, Get Compatible Device Context, build bitmap, draw what I need to (as black/white), ...
Using GetSaveFileName. I specify the OFN_EXPLORER flag, but I always get old dialog appearance unless I avoid using both hook and template. (lpfnHook and lpfnTemplate (and their respective "enable" flags) in OPENFILENAME structure)
If I avoid using just one or the other, I still get the old dialog appearance. I also tried no templa...
What win32 API C functions can I use to read the modification/access/created dates of a file?
...
I have a DLL file that has some helpful functions I want to call in my application. Unfortunately I don't have the documentation for it any longer.
Is there any way I can discover what are the functions exported by the DLL and their method signature?
Maybe there's a utility that lists the functions and their arguments.
Know of any?
...
How to retrieve at runtime the version info stored in a Windows exe/dll? This info is manually set using a resource file.
...
Either with COM or JNI.
...
I'm trying to find a way to replace all instances of a string token in a file with another string.
How can I do this in C++ with the win32 API?
In other languages this is an easy thing to do, but in C++ I am just lost.
EDIT: For some context, this is for a WiX custom action. So portability is not a main priority, just the most simpl...
My Windows application creates custom cursors at run time by using the WIN API CreateIconIndirect() function. The size of the cursor is dynamic and may sometimes be much larger than average (the icon being wider than 300 pixels).
This seems to cause problems when using the application via Remote Desktop (and other similar 3rd party pro...
I have seen code which handles the drawing of this thing (DFCS_SCROLLSIZEGRIP), but surely there is a window style which I can apply to get it "for free". Right?
...
I'm trying to set the text on the "save" button of the Windows "Save file as..." dialog.
I've set up the hook, received the message, found the button (nb. If I call "GetWindowText()" I see "&Save" so I know it's the right button).
Next I changed the text using "SetWindowText()" (and called "GetWindowText()" to check it - the text is co...
I just started a new job that involves lots of COM programming. I'm doing ok so far, by going on my COM fundamentals that I've picked up along my journey as a dev, but I'm the kind of guy that needs to know everything. And working with COM all day irks me since I don't know how this stuff works.
Is there a simple walk through to cre...
Objective: I would like to be able to list the available COM Ports on a system in Delphi.
Homework:
I have read this SO thread on enumerating the LPT ports of a system using the registry. I have also found that the COM ports are listed in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM but found unanswered gesticulation...
I have an application that calls some other utility application to set some settings for a particular device. That utility application is called using ShellExecuteEx.
So as not to confuse the user, it would be better to made the window of the utility application modal to my main window. How does one do this?
Things I've tried:
WaitFo...
What is the standard macro used to write text to the output window in Win32 (outside MFC)?
I am looking for something which the pre-processor conditionally excludes from the release build.
(This might sound like SO sacrilege but I've merely forgotten this one and there was too much noise on Google. We are on the verge of handcrafting ou...
Hi Everyone,
Within Control Panel -> Regional and Language Options, there is a Formats tab, with a drop down of all possible language formats. I wish to retrieve this list using VB.NET. Could anyone point in the direction of which Windows API call to use?
Thanks
...
I have to write a Windows Service application (no GUI) that will monitor an event, and if it occurs will send a standard windows message to an application. The handle of the application will be given to the service by a DLL which is then unloaded, so a windows message is the way we wish to use.
The question though is whether the service...
I have made a window with CreateWindowEx() function, now how do i get the width and height from that window i created? This sounds very basic thing to do, but i just couldnt find any answer ;_;
This is needed because the window height is created automatically depending on how the Windows wants to create it.
Language C or C++
...