In linux, I know with 'ps' you can get the arguments that a command was run with. I need the equivalent in windows
Right now in python I'm doing
Process[i] = subprocess.Popen(cmd + " --daemon --config " + str(i) + ".conf", shell=False)
But I'm doing this in a daemon that is meant to be up all (or most) of the time. Since I'm having t...
Hi all,
Windows Win32 C++ question about flushing file activity to disk.
I have an external application (ran using CreateProcess) which does some file creation. i.e., when it returns it will have created a file with some content.
How can I ensure that the file the process created was really flushed to disk, before I proceed?
By this ...
I want to code a VC++ 9 based console application which downloads an image from a webserver.
I have code which used to run in VC++ 6, but its giving lot of compilation errors in VC++ 9.0.
I need code which compiles in VC++ 9.0 using MS Visual Studio 2008.
Also I need only win32 code and not MFC.
...
Is there a way to define and send custom message types in Win32, to be caught by your Main message handler? For example, my main message handler captures messages such as WM_PAINT, WM_RESIZE, WM_LBUTTONDOWN etc. Can I create my own WM_DOSOMETHING? If so, how would I send this message?
Ah, I actually just discovered this was asked before...
hello
how can I set the current drive in c++?
this is how I set the directory but i'm unable to change the drive like this(duh) but I cant find anything on the msdn site...
anybody know this?
thanks
...
On Windows, how can I find out when monitors (physical display devices) are added/removed/detached/resolution changed/etc.? I'd prefer not to poll EnumDisplayDevices().
...
The win32 API has for example two methods StrFormatByteSize and StrFormatByteSizeEx.
Even though both the methods symantically do the same thing and the Ex counter part only offers a new parameter to slightly change the behavior then couldn't they have two overloads of the same function?
Is it a limitation of c/c++ or what is the possib...
I am using IShellItemImageFactory to extract the icon for a file. I was able successfully extract it and show it in a dialog using
SendDlgItemMessage(hDlg,IDC_STATIC2, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hicon);
see the output: click here
The issue is when I am saving this as a file(PNG format) using GDI+ the gradients are not preservi...
Windows 7 taskbar buttons are drawn on a shaded background. The color shade somehow reacts on where the mouse is over the button.
I'd like to use such buttons in my application. How can i do that ?
...
I'm creating an application with its main window hidden by using the following code:
STARTUPINFO siStartupInfo;
PROCESS_INFORMATION piProcessInfo;
memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
siStartupInfo.cb = sizeof(siStartupInfo);
siStartupInfo.dwFlags = STARTF_USESHOWWINDOW | ...
How can I programatically open a new message window in the default email client (such as Outlook) using Windows API calls? I will need to include an attachment and would prefer to specify the default message body in 'rich text' (ie. not plain) format.
...
I've been able to set local hotkeys like this
RegisterHotKey(hwndDlg, 100, MOD_ALT | MOD_CONTROL, 'S');
how can I set the hotkey to be global?( I want it to be there even when my window is hidden)
...
I'm trying to sort a listview when the user clicks on the column header.
I am catching the LVN_COLUMNCLICK notification like so:
case LVN_COLUMNCLICK:
{
NMLISTVIEW* pListView = (NMLISTVIEW*)lParam;
BOOL test = ListView_SortItems ( m_hDuplicateObjectsList, ListViewCompareProc, pListView->iSubItem );
break;
}
...
I thought I dug most of what I need out of the header files, but I keep crashing out.
Here is the declare I tried using, but I don't think it's just an issue of the declare. I think I'm actually using it wrong.
Private Declare Function GetLocaleInfoEx Lib "kernel32" ( _
ByVal lpLocaleName As Long, _
ByVal LCType As Long, _
ByRef lpLCDat...
I have option to use any one of the API EnumChildWindows or FindWindowEx.
Any suggestions which api is better performance oriented?
Is FindWindowEx internally uses EnumChildWindows to get handle to particular window?
...
I have window with some STATIC labels and BUTTONs on it.
I make all the LABELS transparent background so I can make the background RED say.
In the CALLBACK i process the WM_CTLCOLORSTATIC message, determine the ID of the control with GetDlgCtrlID() and then:
SetBkMode((HDC)wParam, TRANSPARENT); // Make STATIC control Bkgd transparent
re...
I have a window which can be resized, but there are some situations when resizing is not possible because of the application state. Is there a way to prevent resizing the window temporarily?
I want to disable resizing by all means available to the users, which include window menu, dragging edges by mouse, user initiated window tiling pe...
To prevent my application changing the window content while user is moving its window around, I capture messages WM_ENTERSIZEMOVE / WM_EXITSIZEMOVE and I pause the application between the messages. However, sometimes it happens I receive WM_ENTERSIZEMOVE but no WM_EXITSIZEMOVE at all. One repro is:
open the window menu
click on Size
do...
Hi,
I'm creating a process and making a lot of kernel objects requisition to the system. My code is that:
int main(){
//Cria processo para o Data Viewer Unit
LPSTARTUPINFOA si;
PROCESS_INFORMATION pi;
// Start the child process.
if(!CreateProcessA(
"E:\\Documents\\Faculdade\\Matérias\\Automação em Tempo R...
How do I open the CD/DVD door with a Windows API call?
...