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.
...
While working with WinAPI, I decided to implement a call to GetProcessAfinityMask in my C# application. However, I've seen two different signatures for this function.
One of them uses SafeProcessHandle for the handle:
[DllImport("kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern bool GetProcessAffinityMask(...
I can't seem to figure out how to connect to mysql in my windows form application. I've installed all the proper libraries and have included them, thats not the issue. The issue is I can't find a tutorial on connecting to mysql. I've found some one console applications, tried them, but yet for some reason they do not work. I just need to...
What are the Pro's and Con's of using win32api for I/O and other things instead of simply Python, if both have a specific function for it
I mean, using PyWin32 vs Win32Api
...
I'm using teamplayer, which lets you connect more mice to your computer to be used simultaneously. I'm also using pyHook to capture mouse events, with the following code:
import pyHook
import pythoncom
def onclick(event):
# called when mouse events are received
print 'MessageName:',event.MessageName
print 'Message:',event.Message...
nvm, I'll just keep trying or switch over to C#
...
Hi, I want to create a child window that takes up all the space of the left side of main window, but its minimum width is 128 pixels. I also want it to be resizable, but only on the right edge, and makes sure that the width stays at the minimum of 128. Creating the child window with these styles: WS_EX_STATICEDGE, WS_SIZEBOX|WS_CHILD|WS_...
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 ...
I have a window that creates a lot of other common controls such as menus, toolbars with buttons and combo boxes, and a status bar. The problem is that the window never receives a WM_KEYDOWN message whenever I press Enter or Esc, but I need to handle these. Is there any common control that is known to interrupt these keys?
...
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...
Assume that we have two C# structures:
[Serializable, StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct ByteStructure
{
public byte byte0;
public byte byte1;
public byte byte2;
public byte byte3;
public byte byte4;
public byte byte5;
public byte byte6;
...
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...
I get error while calling DeviceIoControl Function to read the MBR of a removable device. The error code is 5. That means access denied! I am using windows xp sp2.
#include "stdafx.h"
#include <windows.h>
#include <winioctl.h>
#include <stdio.h>
BOOL GetMBR(PARTITION_INFORMATION *pdg)
{
HANDLE hDevice; // handle t...
The following code
fRequestHandle = HttpOpenRequestA(
fConnectHandle,
"POST", url.c_str(),
NULL, NULL, NULL,
INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE,
0);
is returning NULL with GetLastError() returning 122. A search suggests th...
System.Environment.UserName internally calls
[DllImport("advapi32.dll", CharSet=CharSet.Auto)]
internal static extern bool GetUserName(StringBuilder lpBuffer, ref int nSize);
Each call seems to hit AD, thus network latency and AD query effect speed of execution.
Would you know if there is a better way to retrieve this value?
Somethi...
I can find what directory the process is running in using GetCurrentDirectory(), but what about finding the directory the EXE resides in?
...
Hi there,
I'm trying to get the handle to the process which loaded a dll from the dll.
My approach is:
in DLL_PROCESS_ATTACH I call EnumWindows(EnumWindowsProc,NULL);
my EnumWindowsProc implementation is the following:
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) {
if(GetCurrentProcessId() == GetWindowThreadProcessId(hW...
I understand how to retrieve the UNC path for a mapped drive from the registry (HKEY_CURRENT_USER\Network), but I also have a need to retrieve remote connections to network resources that were not mapped.
For example, opening the 'Run' dialog and typing <\server0123\share$>. If I type "net use", I would see this mapping, but I have bee...
i am trying to use TTM_GETTEXT via SendMessage using pywin32. the problem is, the structure of the lparam, which is where the text should be stored, has to be TOOLINFO, which is well documented in MSDN, but has no counterpart in pywin32. is there a way to create the same structure using python and pywin32?
Edit: here's the code i came u...
I have a window with 2 child buttons on it and I was originally trying to make their text change color when I hover over and out but when I put the MessageBox () in the WM_MOUSEMOVE message I found out that I stop getting message boxes when my cursor is on either of the buttons. MSDN says that WM_MOUSEMOVE is sent to the window that cont...