windows

python/win32: post a click event to a window?

I want to simulate a mouse click on a window, but I want to post the click event directly to the window (not by simulating a general mouse click using win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)). What's the proper way to do it? I've tried the following, but it doesn't seem to have an effect: def MAKELONG(low, high): r...

RegistryTreeChangeEvent via C# & WMI

I'm getting this error: Unhandled Exception: System.Runtime.InteropServices.COMException (0x80042001): Exception from HRESULT: 0x80042001 at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Management.ManagementEventWatcher.Start() at MyNamespace.Program.Main(String...

Is there a way to sleep unless a message is received?

I'm working in a service whose main loop looks like this: while (fServer.ServerState = ssStarted) and (Self.Terminated = false) do begin Self.ServiceThread.ProcessRequests(false); ProcessFiles; Sleep(3000); end; ProcessRequests is a lot like Application.ProcessMessages. I can't pass true to it because if I do then it bloc...

using both basic and Integrated authentication

We would like to use Integrated Windows Authentication if a user accesses our SharePoint site from within our organization, and Basic Authentication (using SSL) when someone tries to authenticate from outside our organization. Reading, it seems IE will try Windows Auth no matter what and ignore Basic Auth from outside our organization. ...

Windows 7 left click on clock popup

When left single click on the clock in the taskbar on Windows 7 (maybe Vista too) a popup opens showing calender and clock(s) (thus not the date and time adjust window). How do I open this window myself (preferred in C#)? I was hoping timedate.cpl would call this, but this opens the date and time adjust window. ...

Is it safe to recompile an executable while it's running?

What happens if I recompile an executable while it's running? Does the operating system read all of the executable's contents into memory when it starts running it, so it will never read the new executable file? Or will it read sections of the new executable file thinking it hasn't changed, leading to possibly undefined behaviour? What ...

Batch to find and replace

Hi all, I need to replace all occurrences of a specific string with a blank space. More precisely, I need a batch file to find all "NaN" in a text file, and replace it with " " (a blank space). How can I do this? Bests CB ...

Determining Windows OS architecture in a non locale-sensitive manner

Hey all, I'm looking for a reliable way to determine the Windows OS architecture (32-bit or 64-bit) in a manner that isn't sensitive to Windows version or the system locale/display language. I will be using C# to do this. To clarify, I need the OS architecture, not the processor architecture, and not the application architecture. I kno...

How do you ignore the "flick" gestures in Windows?

I'm programming a tablet application that responds to drag gestures. It works great, except when you drag too quickly. Windows interprets it as a "flick," displays an icon on the screen, and does not report that it is a normal drag to my application. This happens for all of the cardinal directions. Is there a way I can turn this off so ...

Problem with colors

I was coding a snake game, and i got an apple image to use in the game, so i created a DC and then loaded the apple to this DC, when the game is running, it should copy the apple to the buffer and then the buffer to the screen, but the apple ends black and white in the screen, any1 has idea why? here is some of my code, might help... ...

Programming language and O/S for a kiosk based system

I am going to be developing some software for a kiosk and was wondering what operating system and programming language I would be best off going with. I understand kiosks a bit and realized there are lot of issues as it pertains to software upgrades, etc so I want an environment that can be easily managed remotely but is also secure. ...

C++: Unhandled exception at 0x0b9ec715 (XX.dll) in XY.exe: 0xC0000005: Access violation reading location 0x00000004.

How do I debug the above error? I'm using C++ with Microsoft Visual Studio. Below is part of the code: HDC dc =*mMemDC; X->SelectPalette(dc); When I debug the code, it crashes on the line X->selectPallete(dc); ...

DDEConnect failing on Unicode

Hello, Why is it that DdeConnect is failing on Unicode but yet working on ANSI? 1) Open Excel and enter some dummy data 2) Create a sample code to read value from Excel via DDE 3) ANSI = Success, Unicode = FAIL Sample code below. I am getting DDE Connection Failed everytime. WCHAR szApp[] = L"Excel"; WCHAR szTopic[] = L"C:\\Tes...

Checking when a file was last modified in C# on Windows OS

Hi, I'm looking to find out a way of seeing when a file was last modified in C#. I have full access to the file. Thanks in advance ...

DLL loading with hardlink

I am trying to devise a method which helps to load DLL from a common location for various products. This helps the following directory structure to avoid file replication. INNSTALLDIR/Product1/bin INNSTALLDIR/Product2/bin .. INNSTALLDIR/ProductN/bin> Instead of replicating DLLs in each product's bin directory above, I can cre...

How to get an accurate 1ms Timer Tick under WinXP

Hello, I try to call a function every 1 ms. The problem is, I like to do this with windows. So I tried the multimediatimer API. Multimediatimer API Source idTimer = timeSetEvent( 1, 0, TimerProc, 0, TIME_PERIODIC|TIME_CALLBACK_FUNCTION ); My result was that most of the time the 1 ms was ok, but someti...

how can I disable windows key in c#?

How can i disable or lock windows button? ...

Windows Mobile: Draw graphic permanently on the screen

Is it possible to draw a graphic (e.g. a rectangle) on a specific area of the screen, in order to be visible all the time even if a full screen application like a game is running? I tried to accomplish this by making a window top most, but like I expected, it got hidden when another program was doing the same thing. Even if I restarted ...

Printing specific lines of a textual file in Windows Batch

Hi Everyone, I'm trying to find a fairly efficient way of printing specific lines of a textual file in Windows Batch. It must be Windows Batch and no other tools (gwk.exe, perl, python, javascript, etc. etc.). I have a list of line numbers (1, 7, 15, 20, etc.) which can be fairly long (dozens if not more). Any ideas? Thanks! ...

.net windows application with sql database + create a setup

Hello, I have created one windows application in .net 2.0 and it uses SQL database in back end. I want to create a setup file for this application so that I can install it and run it on any machine which does not have either .NET framework or SQL Server. Please give me some useful link for this. ...