Usage of ShellExecute()

651 byte By naddynaresh at 2007-11-20 9:31:28
Hi,The usage of ShellExecute() is given below:HINSTANCE ShellExecute( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd);hwnd[in] A handle to the owner window used for displaying a user interface (UI) or error messages....

Usage of TerminateProcess()

905 byte By naddynaresh at 2007-11-20 9:31:29
Hi,I am trying to exit the process using TerminateProcess().BOOL WINAPI TerminateProcess( HANDLE hProcess, UINT uExitCode);hProcess [in] A handle to the process to be terminated. The handle must have the PROCESS_TERMINATE access right. For more information, see Process Security and Access Rights.u...

Virtual Desktop

440 byte By LightningStream at 2007-11-20 9:31:43
HelloI'm making a program with multiple desktops and for the moment that is working fine but the only thing i would like to add is the option to move a running program to another desktop.I've been looking around on the net for some info but there isn't much info around, so my question...

Accessing Shared resources

380 byte By gabirata at 2007-11-20 9:31:57
I need execute a program that is on an remote shared folder. I can do this with a normal application, but when I put the same code on a service running under the System Account it can't access the shared resource. I have read that local service have no permissions on remote resources. So I woul...

Starting your program by clicking on an associated file

1006 byte By Terry Kelly at 2007-11-20 9:32:40
I'm working on a Windows project that should be able to load files that are double clicked from the Windows desktop. I'm fairly new to Windows. On a previous platform an associated file would be passed to the program on the command line. From browsing through the forums it looks like Wi...

Multithreading and windows procedures

27 byte By WhorlyWhelk at 2007-11-20 9:33:17
plz delete this wrong forum

Annoying WinMain Loading cursor

3743 byte By stefys at 2007-11-20 9:34:01
EDIT: PROBLEM FIXEDHello, I am trying to write a console application. I'm gonna start the application by double clicking, but when I double click I don't wanna see the console, I want it just to run in background, because it's annoying to have an application that is supposed to run pe...

HDCs

727 byte By Fromethius at 2007-11-20 9:34:20
Hello everyone,I have this code: Image* newImage = Image::FromFile(szFileName); Bitmap image(50, 50); Graphics graphics(&image); HDC gfxHDC = graphics.GetHDC(); graphics.DrawImage(newImage, 0, 0); int pixel, row; for (pixel = 1, row = 1; row <= 50; pixel++) if (GetPixel(gfxHDC, pi...

Cursor always at 32x32

814 byte By Coder Noob at 2007-11-20 9:37:15
Hi I'm trying to change my cursor whenever a certain button on a toolbar is clicked. I'm using plain old WinAPI (which is why I'm posting here). This is basically my process/* This part is actually in the .rc file */MYCUR CURSOR "../Images/MyCur.cur"/* Now the .cpp file */#define MYCU...

I/O traffic/activity for the whole system

377 byte By shopgirl at 2007-11-20 9:37:29
Hi all, Could anyone help me with getting the I/O traffic for the whole system? I need to monitor at computer-autostart de CPU usage and the I/O traffic for the whole system before starting my own application. The CPU usage was somehow solved with Perf.lib but I didn't find yet a solution fo...

Installer fails while reading the function from DLL in Windows 2003 server

3605 byte By naddynaresh at 2007-11-20 9:37:52
Hi,I created a Windows installer DLL using Visual Studio C++ and added a custom action in my installer for the dll. my .cpp file given below:#pragma comment(lib, "msi.lib")#include "stdafx.h"#ifdef _MANAGED#pragma managed(push, off)#endifBOOL APIENTRY DllMain( HMODULE hModule,...

Listview group divider color

106 byte By eshipman at 2007-11-20 9:38:40
What determines the color of the divider line between the <br/>groups in a listview in the attached image?

WriteFile issue

332 byte By George2 at 2007-11-20 9:39:01
Hello everyone,The 3rd parameter of WriteFile is number of bytes to write, http://msdn2.microsoft.com/en-us/library/aa365747.aspxI am wondering if I want to write multi-byte character string or wide character string on Windows, how could I get the number of bytes?thanks in advance,George...

LPCTSTR and HRESULT

265 byte By George2 at 2007-11-20 9:39:11
Hello everyone,<br/>If I want to convert LPCTSTR and HRESULT to standard C/C++ data type (like char*, int, long, etc.), I am wondering what standard data types should I convert to be safe and do not lose and data precise?<br/>thanks in advance,<br/>George

Issue in drawing strings in static conrtrol

470 byte By balakun at 2007-11-20 9:39:21
Hi, I want to draw two strings stored in two different variables on a single static control using windows programming. I cannot use MFC as I have size limitations for the dll. For ex, I have a code snippet as below. WCHAR* first = Hello; WCHAR* second = World;and I want to show the text as "Hello W...

Is there substitute of StretchDIBits?

243 byte By guoyanpeng at 2007-11-20 9:39:23
Calling StretchDIBits in my code usually cost too much time if the size of bitmap is big. I know this API will expend too much CPU resources. Is there any other API or method to replace it, which can accelerate the performance? Thanks. :wave:

Accelerators in XP

356 byte By Kansana at 2007-11-20 9:39:31
Hi All,I have created the accelerators for the following keys in the resource file and have handled those events.Alt+F4F1Ctrl+CThis works fine in the Vista OS. But in case of XP, the accelerators are not getting recognized. Please let me know how to fix the accelerator issue in XP.Thanks,Kansana...

Does GetCurrentDirectory return the same path name of exe?

401 byte By xkwooo at 2007-11-20 9:39:34
Hi,I am making a simple app to get the full path name to the app and other files locate at the same directory. So I choose ::GetCurrentDirectory, but later I found what it retrieved is the directory where .vcproj resides, not the .exe. So I wonder if the app will correctly find where it is after dis...

LoadAccelerator fails with HRESULt value 0X80070715

226 byte By Kansana at 2007-11-20 9:39:43
Hi all,<br/>In XP machine, the LoadAccelerator function in my code fails with the HRESULT value 0x80070715. Please let me know the cause the error and how to fix it.<br/>Thanks In advance<br/>Thanks,<br/>Kansana

Forcing windows program to close "gracefully"

321 byte By srobik at 2007-11-20 9:40:06
I'm trying to find a way to have program A close program B. I know you can send the WM_CLOSE message to the top level window, but this means that the program prompts to save it's data i.e. the document is dirty. I need to close the application without it prompting. Any suggestions on how t...

Trouble with CreateWindowEx()

1226 byte By cuziyq at 2007-11-20 9:40:20
I am having trouble using the CreateWindowEx API function in my program. I have a Controller object that creates and registers a WNDCLASSEX structure (which works just fine). But I have several other objects that use CreateWindowEx to put new windows on the screen.The second parameter to the Creat...

file IO

1741 byte By wheelie at 2007-11-20 9:40:44
I have an OpenGL program that im trying to understand, and i would liike to output the following infomation to a text file so that i can see what is stored in flagpoints [][][0-2]// loop through all of the flag points and calculate the sin wave // for the z-coordinate. x- and y- coordinates equal to...

Compiler error with AddFontMemResourceEx

522 byte By anders2 at 2007-11-20 9:40:59
Hi allI'm trying to use AddFontMemResourceEx in my app, but gets compiler error C3861 identifier not found. I've included windows.h and gdi32.lib. I've even tried to include wingdi.h where the declaration seems to be but I get the same message. If I try to copy the declarations from w...

SendKeys in C++

318 byte By Fromethius at 2007-11-20 9:41:22
Hello everyone,Is there an equivalent to SendKeys.Send in C++? I have looked into keybd_event and SendInput, but to my knowledge you can only send one key at a time with those functions.Thanks for any help.Edit: I'm not using the .Net Framework so I can't use any of that stuff....

CoInitialize() question

207 byte By yaniv_av at 2007-11-20 9:41:32
Hi, <br/>How can I know if CoInitialize already called in the current thread ?<br/>(I know that it encapsulate reference counting, but I still don't want to call it more than once)<br/>Thanks.

Name of window

586 byte By UnfitElf at 2007-11-20 9:41:59
Hi people,I have the need to create a little selector. I’ve seen them around on other programmes but not sure what they are called.Basically they are a tiny textbox with two small buttons to the right of it, one pointing up, the other pointing down. When the user clicks the up button the numbe...

Removing non-empty directory

195 byte By George2 at 2007-11-20 9:42:05
Hello everyone,<br/>I am wondering how to remove a non-empty directory on Windows? I find that function RemoveDirectory works only for empty directory.<br/>thanks in advance,<br/>George

pass multi-byte (or wide) characters to DeleteFile

321 byte By George2 at 2007-11-20 9:42:07
Hello everyone,The prototype of DeleteFile is,BOOL WINAPI DeleteFile( LPCTSTR lpFileName);I am wondering if the input parameter (string) is multi-byte characters or wide characters, how should I pass them in? Do I need to do any conversions?thanks in advance,George...

[RESOLVED] Checking the state of a process

252 byte By greve at 2007-11-20 9:42:17
I have started another process from within my program by spawnl with parameter _P_NOWAIT, i.e in asynchronous mode. I would like to check the state - at least whether the other process is still running. Any suggestions?<br/>Many thanks in advance.

can not delete a file

1284 byte By George2 at 2007-11-20 9:42:24
Hello everyone,I am using the following program to delete all files in a specified directory. But when running, no files could be deleted, and the related error information is,failed with error 5 -- access denied. Anything wrong with the program?remove_non_empty_directory ("c:\\temp\\non_empty_dir\\...

Can not get latest ICMProfile

1659 byte By shahketank23 at 2007-11-20 9:42:29
I have written code for getting monitor profile. It gives always same result once application activated even we change profile. if we open another application it gives proper result. The Application calles dll function using JNI. the code for getting ICM Profile as follows#include <jni.h>#incl...

CreateService

1150 byte By gabirata at 2007-11-20 9:42:39
I'm trying to create a service with a real account name other than the LocalSystem account. So I call the function CreateService this way:createdService = CreateService( schSCManager, // SCManager database SVC_NAME, // name of service SVC_DES...

License Key

229 byte By gabirata at 2007-11-20 9:43:18
How can I retrieve the Windows's license key. The HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion subkey has a value LicenseInfo, but I don't know if this value hold the key information.<br/>Thanks!

Sending SMS via HTTP or SMPP

394 byte By KTC++ at 2007-11-20 9:44:55
HiDoes anybody no how to do this, or do you no of a full working example of this in action, in C++? ive done a bit of research but really want to see a finished project with it all working. And i dont want to have to connect a phone to the COM port either it really needs to be wirelessIs there a way...

Hard Disk Image creation

223 byte By bharath_neo at 2007-11-20 9:45:10
Hi,<br/>I wanted to know what is the method to create a .img out of a partition in the disk (I mean a bit level copy of the whole disk) and later copying data back into another partition from the .img file.<br/>Bharath

Handle of process to process id

325 byte By greve at 2007-11-20 9:45:38
When spawnX() starts a process in asynchronous mode it returns the handle of the new process. Somne functions dealing with processes e.g. GetWindowsThreadProcessID() return the processes ID. What's the relationship between handle and id? Is there a function for transformation?Thanks in advance...

IRowsetIndex:: Seek in eVC++

1867 byte By farzanakhf at 2007-11-20 9:46:14
Dear Friends,We are working on C++ in eVC++ 3.0 environment (CE 3.0) with SQL CE 2.0. We are trying with IRowsetIndex:: Seek method to access the data from the database.We are facing problem when we try to access data from the table having composite index other than the first column.For example:The...

C++ SLL Socket

653 byte By Tavo at 2007-11-20 9:47:06
Hello, I was going to make a socket API for windows, but I found that, actually, there is a lot of code and proyect of sockets. But I looked them and some of them work with the MFC (I don't want to work with the MFC), and others with the windows API. But in my search, I realised that a SLL Sock...

Popup Menu Bitmaps

401 byte By bitshifter420 at 2007-11-20 9:47:08
Hello Fellow Guru!How Do I Define A Bitmap In A Popup Menu Resource?Right Now I Am Adding The Bitmaps At Runtime.I Am Fluent At Creating Menu's At Runtime Or In A Resource,And The Same Goes For Bitmaps.I Just Need The One Line Of Resource Code And Im There;)Also, Are Menu Bitmap Metrics 13 By 1...

RegSetValueEx type casting problem

1009 byte By kabilius at 2007-11-20 9:47:24
Greetings,Here is a Andreas Masur's tutorial which I found in the FAQ section: if(::RegSetValueEx(hKey, "NameOfValue", 0, REG_DWORD, reinterpret_cast<BYTE *>(&dwValue), sizeof(dwValue)) !...

SubClassing BUTTON class

1399 byte By SSkillZ at 2007-11-20 9:47:38
Hello,I want to subclass the system Button class (not MFC), so far I just changed the callback of all the button windows in a dialog to a new callback of my own, which handels WM_PAINT, and then callls the controls orignal WNDPROC function.I can get the class WndClass structure of the systems Button...

application failed to initialize properly (0xc0150002)

302 byte By prabhakar157 at 2007-11-20 9:47:42
Hi, i am using win32, C++ and Open Dynamics engine... i am getting this error when i make release verision. and run the exe on a different machine. i have checked all dependecies.. but unable to figure out what the problem is.. please help me .. i am using VC++. NET 2003. Thanking you in advance....

Encoding characters in URL

577 byte By ramyaa at 2007-11-20 9:48:24
Hi ,I had been looking for Win32 API to encode some special characters like + % & etc ( those are called URL Escape Codes) and i found InternetCanonicalizeUrl and UrlEscape - Both of them work but they dont encode all the URL Escape Codes ( for example "+" is not encoded to %2B )Could somebody help...

resource file not working

983 byte By nerdykid at 2007-11-20 9:49:06
first of all, im not even sure if this is supposed to be in this categoryim trying to make a simple window which doesnt contain any text. there is a menu with not much in it.this is the .rc file#include "resource.h"IDR_MYMENU MENU //Declaration terminated incorrectlyBEGIN POPUP "&File" BEGIN...

mmap and read-only files

1338 byte By cruppstahl at 2007-11-20 9:49:08
Hi!i have a small question :)i'm writing a database library. It uses memory mapped I/O, if possible. i use mmap for reading, but WriteFile for writing, and it works great. To map a page, i use the following code (the code is truncated, no error checking etc):// open the fileHANDLE fd=CreateFile...

Passing variable to the WindowProcedure

755 byte By Fromethius at 2007-11-20 9:49:33
Without creating global variables, is there a way to pass variables to the WindowProcedure that handles the messages?For example, if I create a variable and initialize it in WinMain, is there any way to use it in my WindowProcedure?What I am doing is this. I have a class called Map. I also have a cl...

Window HANDLE from Device Context

313 byte By bidesh at 2007-11-20 9:50:07
hi all,i have a member in my class which is an HDC value. I want to get window handle from the device context.acctualy i want to draw an image in the background of my window. for which i need to get the client rect of window. for this i need the window handle.thanks,bidesh...

how to monitor change in file

534 byte By Wolvorine at 2007-11-20 9:50:09
hi,My requirements are to monitor the change in file, i can see changes like delete file new file or update file but to find which offset was change in any file needs to have a sort of backup old file by which after comparision we can tell which parts of the file has been changed. But this is not a...

How get system32 CPU speed ?

497 byte By sirnoname at 2007-11-20 9:50:12
Hi, i got SpeedswitchXP application and other tools which shows youthe actual cpu speed out of windows without using selfmade codeof speed calculation. This value is very stable and out of the system.It is the same if you go to start->settings->systemcontrol->system.The first sheet shows yo...

how to do a recursive file search

212 byte By dmat619 at 2007-11-20 9:50:59
I am looking for a way to do a recursive file search using C++ . I am new at C++ and feeling somewhat lost. If it matters, I am using windows 2000.<br/>Any help would be greatly appreciated.<br/>Thanks,<br/>Dan