windows

How to get folder path for ClickOnce application

I need to write a file in the same folder where a console ClickOnce .application (executable file) resides. The folder where it launches from. I tried using Application.StartupPath & Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) but the path is pointing to a subfolder under c:\Documents & Settings. How do I get the pat...

A simple way to convert to/from VARIANT types in C++

Are there any easy-to-use, high-level classes or libraries that let you interact with VARIANTs in Visual C++? More specifically, I'd like to convert between POD types (e.g. double, long), strings (e.g. CString), and containers (e.g. std::vector) and VARIANTs. For example: long val = 42; VARIANT var; if (ToVariant(val, var)) ... ...

Screen is flickering even when using doublebuffering

I am totally new in programming. For my first programm I tried to make a small game in c with windows api. the following code is a nearly working snake, (some bugs not fixed yet) but i cant find a working solution to fix that flickering. (I dont know double Buffering so I just took from here: [http://www.codeguru.com/forum/archive/index....

How do I check if a program has already been executed during the current login session? (Windows)

In an application I am developing (in C), a loader app must first be run before the main application is executed. I have made it so the main app runs the loader app as a child when it is launched in order to automate this task. This all works well, except for the fact that the loader app only needs to be run one time during the user's cu...

Windows Equivalent of System Configuration Directory

I am developing a CLI application in Ruby, and I'd like to allow configuration in Unix via the standard config file cascade of /etc/appnamerc, ~/.appnamerc. However, the application is also meant to be run in a Windows environment, and I'm unsure of where one would put a file like /etc/appnamerc (C:\windows\system32\etc\drivers does not ...

Trying to compile with cl.exe

Sorry if this is a simple question, I don't do much programming in Windows. I have Visual Studio installed but when I try to execute "cl" from the command line it tells me it's not recognized as a command! How do I get cl? ...

How do I correctly install dulwich to get hg-git working on Windows?

I'm trying to use the hg-git Mercurial extension on Windows (Windows 7 64-bit, to be specific). I have Mercurial and Git installed. I have Python 2.5 (32-bit) installed. I followed the instructions on http://hg-git.github.com/ to install the extension. The initial easy_install failed because it was unable to compile dulwich without Visu...

Why malloc always return NULL

Hi, guys, My dev environment is VS2008, DX9, Windows XP. I try to add protection handling to the out of memory case. When malloc return NULL, I would page some resource to disk, and release the resources in the memory. But sometimes, malloc always return NULL, even if I release most of resources and process memory usage and VM size is o...

How to get a file's size which is greater than 4 Gb?

Hi! I made a simple function, which get's a file's size. int file_size( char * filename ) { int size; struct stat st; stat( filename, &st ); size = st.st_size; return size; }//file_size It is working fine, but if i have a file which size is bigger than 4Gb than i get a negativ number back, and of course th...

From windows mobile how to send a C# object to a http stream

Scenario: Windows Mobile C# Compact framework 2.0 or 3.5 Protobuf object I need to send an object to a http url (Post). Afterward I will wait for a response and receive a modified version of the object back. Any input on how to connect to a http stream and passing in a serialized object? ...

Open-source echo server

Does anyone know any open-source echo server? I know I could write one by myself, but I'd like something more fancy with ability to listen on certain port(s), send keep-alives etc. so developing this myself would take likely hours. ...

DLGTEMPLATE gui editor as a library or a component

I'm looking for a Windows (pure DLGTEMPLATE output no .net resources!) dialog template editor (as a library or component) that can be used to modify or/and create new dialog templates for DialogBoxIndirect() function. ...

Windows serial port timing?

I need to measure the time between character events on a serial port, preferably under Windows 7. I have read in various places, statements like "Windows will not provide greater resolution than 10ms", but I have not been able to find out what that really means. Is the problem that the OS will not deliver the events with greater accuracy...

Installing IIS 7.5 on Windows Server 2008

I would like to know if I can install IIS 7.5 on Windows Server 2008 and NOT Windows Server 2008 R2? ...

Is there a way to get an event from windows on every new process that is started?

Hi I want to get a notification each time a new process is started by the operating system. Note that I need to that in native code (I know it can be done in managed code using System.Management members). Extra points if there is a way to get it before the process starts running :) (i.e in during its initialization) Thanks. ...

Shell Extension: DragQueryFile returns at most 16 (in Windows 7)

I've writtten a shell extension (guided by The Complete Idiot's Guide to Writing Shell Extensions) which worked as it should until I upgraded to Windows 7(32bit). Now, the function DragQueryFile UINT uNumFiles = DragQueryFile(hDrop,0xFFFFFFFF,NULL,0); returns the right number of selected files until the number is above 16. Then alw...

fnmatch for windows in C?

Is there a version of fnmatch for Windows? I'm trying to have the same functionality (basically using *'s from the command line for the filename) in C without having to call FindFirst() etc. Code is appreciated. EDIT: I need to accept wild cards from the command line for filenames, for example *.txt and be able to open each .txt file....

How can I hide a window while keeping it on the taskbar and the Alt+Tab list?

In Delphi I can do something like: var hWin : HWnd; hWin := GetForegroundWindow; ShowWindow(hWin, SW_HIDE); and hide the window of the topmost application. The problem is that this also hides the application from the task bar and the alt-tab window. Is there any way to only hide the window without hiding the app from the taskba...

I need to write a .DDS file cross-platform, can someone point me to example?

I need to create a .DDS file with code that runs on both OSX and Windows. Although the format doesn't look difficult, I'd still like an example of writing the file. Note I don't need to read it, just write it. C or C++ and RGBA bitmap. ...

Great tools to find and replace in files?

I'm switching from a Windows PHP-specific editor to VIM, on the philosophy of "use one editor for everything and learn it really well." However, one feature I liked in my PHP editor was its "find and replace" capability. I could approach things two ways: Just find. Search all files in a project for a string, see all the occurrences li...