windows-programming

Collapsible controls in MFC (example included)

In the WindowsXP Control panel, you can see a nice collapsible panel control on the left: These are not just collapsible, but animated too. I wondered if these are any kind of control accessible to a developer, specifically in MFC? Or are they custom/bespoke functionality? ...

SHLoadImageFile(L"\\Program Files\\TrainingApp\\background.png"); whats that L in the argument for?

Hi, ive been working on c++ on linux for the past 2 years,and switched to windows c++ programming recently. can anyone tell me what that L is there in the argument of the function: SHLoadImageFile(L"\\Program Files\\TrainingApp\\background.png"); and on viewing certain sample code in MSVS C++ i came across hundereds of typedefs like...

Any Win32 APIs to get the screenshots?

Hi all, I am writing an app, which needs to take the screen shots automatically (just like pressing PrintScreen button). So please suggest me how to get this done. A raw 24 bit BMP image would suffice. PLEASE NOTE: My app is in C, so any win32 APIs that can be called from my code is what I am looking for. (Sometimes back I had got an e...

Get list of windows in taskbar on Windows 7?

Hi, how can I get a list of windows shown on the taskbar on Windows 7? I have tried EnumWindows, but I'm getting way more windows than those shown on the taskbar (800 vs 15). ...

Need GDI programming Guideline

I want to change my window design rapidly. I have OnPaint function which I am calling when WM_PAINT message received. The design change only when the event occure. I want that design should automatically update doesn't depend on event kindly guide me how can I make it possible. ...

Getting HWND of current Process

I have a process in c++ in which I am using window API. I want to get the HWND of own process. Kindly guide me how can I make it possible. ...

Send email from windows application (C++)

I am programming a process monitoring tool which is written in C++, windows application. Is there anyway to send out alert email when the tool find the process go down? Any library support this? or any solution is fine. Thanks. ...

Linker error with RegSetKeyValue.

Hi *, I am using "RegSetKeyValue" API in my application. I am referring to http://msdn.microsoft.com/en-us/library/ms724921(VS.85).aspx. As told in the article, I have defined _WIN32_WINNT_ as 0x0600 and have included Advapi32.lib in my linker options. But still I am getting linker error, "unresolved external symbol _RegSetKeyValue"...

Hiding Mouse Pointer on window Screen using GDI in c++

How to hide the mouse pointer on the window screen of GDI, kindly give me some hints. ...

UTC timestamp in milisecond using c++ under windows

How to get the UTC time in milliseconds under windows platform. I am using Standard library which give me UTC time in seconds, I want to get time in miliseconds, kindly give me the reference of any other library which give me the accurate UTC time in miliseconds. ...

Sleep Function Error In C

I have a file of data Dump, in with different timestamped data available, I get the time from timestamp and sleep my c thread for that time. But the problem is that The actual time difference is 10 second and the data which I receive at the receiving end is almost 14, 15 second delay. I am using window OS. Kindly guide me. Sorry for my...

Sleep thread 100.8564 milisecond in c++ under window plateform

I there any method to sleep the thread upto 100.8564 millisecond under window OS. I am using multimedia timer but its resolution is minimum 1 second. Kindly guide me so that I can handle the fractional part of the milisecond. ...

Make MessageBox stay on top of other windows

I have a TimerProc which calls MessageBox. I want the MessageBox to stay on top of other windows. So for example, the parent window sets the timer, then I move another window on top of that. When the timer fires, I want to MessageBox to appear on top of the window that is covering the app. Is this possible, and how should I go about doin...

File Writing issue in c

I am writing the log file in my c application, the method for writing the file is fopen_s(&fMainFile, "c:\\LOG\\Filter.txt", "a"); fprintf(fMainFile, "SomeText"); fclose(fMainFile); I open the handle, after writing I closed it, but this writing crash my application after a while, can any one sort out this problem, that how much dange...

Syncronize system clock with UTC time using c uder Window OS

I have UTC time which is coming from UDP, I have a program to calculate Day and Time of UTC, how can I set my system clock at that day and time, kindly give me some direction so that I can make it possible. I am using window OS. ...

File Reading issue in c++

I have the following program, int iIndex=0; char cPort[5]={"\0"}; char cFileChar; fopen_s(&fFile,"c:\\Config\\FileName.txt","r"); if(fFile !=0) { cFileChar = getc(fFile); while (cFileChar!= EOF) { cPort[iIndex]=cFileChar; iIndex++; cFileChar = getc(fFile); } iDIPort=atoi(cPort); } in the file I have 32000, but when...

CreateThread issue in c under window OS

I have the following code which initiate the thread. int iNMHandleThread = 1; HANDLE hNMHandle = 0; hNMHandle = CreateThread( NULL, 0, NMHandle, &iNMHandleThread, 0, NULL); if ( hNMHandle == NULL) ExitProcess(iNMHandleThread); My question is What will happened if I run this code while the thread already in the running state. I want ...

Set focus on console in Windows?

Is it possible to set focus on a console app in Windows? SetFocus looks promising, but it needs an HWND and I don't know if console apps even have one. ...

how to capture packets in a Windows application that must be installed as non-admin?

Hi, Is it possible to write a Windows app that can capture packets on the PC such that this application can be installed/run as non-admin? If yes, what would be the approach, e.g. which language, which API/Library to use etc (e.g. would it be with the Windows Sockets 2 (Winsock) library?) I've looked at Network Monitor API's however t...

Source IP from UDP packet in c under window OS

I want to get the source IP of UDP packet kindly guide me so that I can make it possible. I am working in c under windows platform. ...