windows

KeyBoard Stroke Events

what i want to do is have a background application which by itself or its modules run only when a certain key is pressed. Like when i press F10 some code that i have written executes and then quits or goes to sleep then again when i press F10 i executes again and goes to sleep but in between keystrokes it does not takes any processor tim...

DShow : How to get a particular filter?

Hi, I am trying to connect filters in DShow, there are two filters I want to add to my filter graph. I know I can use system device enumerator (ICreateDevEnum) to enum all the filters in a category. But, This method is not very convenient, because I have to enum all the category to get a particular filter. Is there a better (faster o...

Correct syntax for using Runtime.exec with "Program Files"

I wish to use the method with the following signature: exec(String command, String[] envp, File dir) Suppose my program is called "myprog.exe" and it is located at "C:\Program Files\My Software". What is the correct syntax for using Runtime.exec? I keep getting an error message "The system cannot find the file specified". To clarif...

Java file locking and Windows - the lock isn't "absolute"?

Hi, I'm trying to lock a file with Java in Windows environment with FileLock and I got an issue : after I lock the file it can still be accessed by other processes at least on some level. Example code follows: public class SimpleLockExample { public static void main(String[] args) throws Exception { String filename = "loremli...

How can I run an executable from RAM using C++?

How can I run an executable from RAM using C++? The executable is in RAM, and I know the address, how do I call into the program from mine? ...

Placement of Qt4 widget on windows

Hi, How can I place a Qt4 widget just above the system tray on windows. Since exact coordinates may depend on resolution and even the size and placement of the task bar(top or bottom of the screen etc.)? I think there is probably a method for getting the screen resolution, but is there any method for getting the size of the taskbar and...

What type of network traffic does not use Winsock in Windows?

I am developing some low-level stuff (LSP) and found out, that SMB traffic does not go through LSP, because SMB does not use Winsock. There is a paragraph in MSDN about it, but this is in part of MSDN dedicated to Windows CE. So, is there any comprehend list of whole traffic that does not go through Winsock? MSDN is bit messy about that....

What's up with "GetStockObject" ?

I've created a program in Eclipse / MinGW / C (project type: C) which should just present an empty window. It also has the folowing line: wndclassex.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); The call to GetStockObject() produces a compiler error: Z:/mtsts_workspace/MTSTS/Debug/../WinMain.c:29: undefined reference to ...

Is it possible to force Scite as topmost window?

I am using SciTE as text editor. It is possible to run script and see the results in its console output. The application I am working on is displayed fullscreen and is hiding SciTE. Is there an option to make SciTE always visible? I am working on Windows. Thanks in advance for your help ...

How to tell if a file has no associated icon

I am using the SHGetFileInfo api to get a handle to and display the icon associated with a particular file. If the file has no icon associated with it Windows will return you the default one that it uses in explorer for unknown file types. In this case I don't want to display the icon. How can I tell if the file has no associated icon...

Determine on which physical processor my code is currently running

Is there a Windows API or any way to determine on which physical processor/core my current thread runs? I don't need that information. I'm just curious. Edit: I'm not interested in the processors the thread is allowed to run on. I would like to know on exactly which one it currently runs. I know that the threads switch pretty fast from ...

Find mapping between Windows heap and modules

Hi all! I am searching for a way to find a mapping between a heap and the module which owns the heap. I retrieve the heaps in the following way: HANDLE heaps[1025]; DWORD nheaps = GetProcessHeaps((sizeof(heaps) / sizeof(HANDLE)) - 1, heaps); for (DWORD i = 0; i < nheaps; ++i) { // find module which created for heap // ... } The ...

C#/WINAPI: SetWindowPos()

Hi, I am using SetWindowPos() to try and send Windows to back/front of the z-order. It seems to work for the most part however I am noticing for certain windows it just won't work although the function will return success. For example Window Task Manager seems to work perfectly fine but the other windows aren't responding properly to th...

detect alarm notification in WM6

Hi, I made a game on windows mobile 6 platform using DirectDraw (DDSCL_NORMAL), but i cant receive the alarm notification event, no message occurs in WndProc(), seems like my code totally blocked the alarm application. Is this a problem of DirectDraw? or is there anyway i can detect this event? Any help would be awesome. Thanks in advan...

Does SHGetPathFromIDList() (and similar) put a terminating 0 in its argument?

This is actually a question about a huge number of winapi functions. A typical MS documentation says (from http://msdn.microsoft.com/en-us/library/bb762194%28VS.85%29.aspx ): BOOL SHGetPathFromIDList( PCIDLIST_ABSOLUTE pidl, LPTSTR pszPath ); pidl [in] The address of an item identifier list that specifies a file or direc...

CSP Out of memory with CryptVerifySignature

I have an issue with CryptVerifySignature returning NTE_NO_MEMORY (The CSP ran out of memory during the operation.) I'm trying to verify an signature generated with OpenSSL, I've already decoded a PEM public key, reversed the byte-sequence and imported it. I've tried explicity specifying the MS Enhanced Provider, and my key length is 4...

PHP send mail on windows causing it to 'hang' after sending email

Hi, we're starting to build a web app. My colleague is developing on linux, and I am running via a WAMP stack running windows xp. We're using Zend. When we submit a form and send an email using Zend email, the email would send and then I would get a blank screen, wheras on the linux machine the app would continue normally. So I wrote m...

When debugging on Windows where does stderr go?

When trying to debug a program on Windows I can't seem to find where the output I push to stderr is going. How do I get a hold of my stderr output? Is there a debugger-level setting (MSVC 9) I can change to redirect stderr to some part of the UI? Update: I have not looked into TRACE or OutputDebugString, but the code base is cross-platf...

Checking if a Folder/File is Hidden/System in Windows C/C++

I am writing a Cross platform application using C++/STL/Boost and I realized they do not provide a way to check if a folder or file is hidden or is a system file in Windows. What's the simplest way to do this in C/C++ for Windows ? Ideally I have a std::string with the path (either to a file or folder), and would return if it's hidde...

How to explicitly specify a path to Firefox for Selenium?

I got Selenium IDE, followed this post, got to python test_default_server.py and it complains Firefox is not in my path: Please add the directory containing ''firefox.exe'' to your PATH environment variable, or explicitly specify a path to Firefox 3 like this: *firefox3c:\blah\firefox.exe I could change my PATH environment variable...