ok so i nee help with this constructures
struct balls {
balls()
{
SetTimer(hWnd, balls.BALL_ID, 1, null);
}
int Ex;
int Ey;
UINT_PTR BALL_ID;
};
well when i set the timer im having trouble with balls.BALL_ID. the compiler thinks that balls is structure like balls something. wel...
ok well i have structure
struct balls {
balls(UINT_PTR const &val) : BALL_ID(val){}
int Ex;
int Ey;
const UINT_PTR BALL_ID;
};
balls ball1(0x1);
and i have a switch statement
switch(wParam)
{
case ball1.BALL_ID:
if(ball1.Ex<300)
{
ball1.Ex++;
...
i have to variable of HANDLE type .
first variable is a process HANDLE (with name hProcess) that have'nt PROCESS_QUERY_INFORMATION access right.
second variable is a process HANDLE (with name hwndProcess) too that i opened via OpenProcess function and have PROCESS_QUERY_INFORMATION access right. i sure both process is a one.
but when ...
I would like to obtain the current process id in a JScript script. This id is returned by the Windows API GetCurrentProcessId (http://msdn.microsoft.com/en-us/library/ms683180.aspx) function. How do I call this function in JScript?
This obviously doesn't work:
var id = GetCurrentProcessId();
WScript.Echo("ProcessId is " + id);
...
Hi all.
I have a thread that needs to dispatch a message (a simulated mouse event that it sends using SendInput) as soon as it's generated. I want this to happen in a loop where there is no sleep; adding any sleep hurts performance as I basically want the events to go in to the event loop immediately once they have been generated. Of co...
Hi, I am trying to display file type of given filename (based on extension) using AssocQueryKey() API function.
The problem is thar return wrong HKEY value sometimes. For example the following function works correctly on win 7 ultimate x64, but fails for some extensions like ".mp3" on my win xp x86 machine (other extensions works though)...
I want to scan the entire heap of a currently running native application through another process.
For example, I want to know what follows all the instances of the ASCII sequence "test" in this process memory (in this case I would scan for "test" and keep reading after it).
I tried to google for more information but didn't find much: I...
A google search shows a few examples on how to download a file in Delphi but most are buggy and half of the time don't work in my experience.
I'm looking for a simple robust solution which will let me download a single exe (for updating my app) and will hold the execution of the current update thread until the download is done or error...
Can I monitor changes to the System Time Adjustment (which is change by SetSystemTimeAdjustment())?
I need to monitor such changes for a high-accuracy real-time spectrogram view.
Note:
I know that WM_TIMECHANGE is sent whenever the system time is changed. This is not what I'm asking for.
...
Ok so my double buffer works fine but it seems that it use a lot of memory.
i know that double buffer should store a copy of the ellipse I'm drawing than paint it on the screen but it after that it deletes the copy and makes new copy but it doesn't seem to delete it
here is my code
hdc=GetDC(hWnd);
HDC memDC=CreateCompatibleDC(hdc);
H...
I'm trying to rewrite the following autohotkey script in Python:
Gui +LastFound
DllCall( "RegisterShellHookWindow", UInt,WinExist() )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
LastActiveWindowID := WinActive("A")
Return ; // End...
I need an input box in a UI program that is already written derived from the CWinnApp class and using MFC.
I see it is using message boxes but I don't see any examples of input boxes....
How do I do this?
(Using Visual Studio 6.0 in C++)
Thank You.
...
I'm trying to change the background color of a program I did NOT write.
Looking at it with Spy++ I can see that the main class is "ThunderRT6FormDC". One of its children has the class "ThunderRT6Frame". Inside ThunderRT6Frame there are a bunch of ThunderRT6CommandButtons.
I want to change the background color behind the buttons. I trie...
I'm using the AnimateWindow API to show or hide a Form with a slide animation. The problem is that if the Form contains a RichTextBox control, it doesn't display this control correctly. It's transparent and doesn't show any text.
After the animation is complete, double clicking somewhere in the control will reveal lines of text.
I've c...
I am creating a window which opens to a dynamic title. I would like to have the window's title truncate if the window is resized and there isn't room to show the full title.
For example, I have
HWND handle = GetHWND(); // gets me the correct handle
std::wstring title = L"some fairly long window title";
SetWindowTextW(handle, title.c_s...
I did see this to modify CFileDialog (http://support.microsoft.com/kb/105497) but it looks like a lot more than I need.
I'm using the CFileDialog to pick files, is there a simple way to use it to just select a directory?
Any other suggestions?
(I also saw this but is for XP only?
http://msdn.microsoft.com/en-us/library/aa16394...
I have created a window which has a toolbar with some icons, and I launch one more window clicking on the available icon from the main window.
First window is created using CreateWindowEx method.
the one I click using an icon is created using dialog resource.
So without closing dialog, I directly close the main window. I see that dialog...
I have a multithreaded Windows application where one of the threads has a message pump in it. I need to send a message to that thread, passing information to it. However, one of the libraries I want to use in the worker thread requires std::string. Can I do something like the following:
typedef struct tagCOMMAND
{
std::map<std::stri...
Hi,
In C++ how can you use threads to not block my receive functionality in case of Sockets?
// Receive until the peer closes the connection
do {
iResult = recv(lhSocket, recvbuf, recvbuflen, 0);
if ( iResult > 0 )
printf("Bytes received: %d\n", iResult);
else if ( iResult == 0 )
printf("Connection closed\n...
For example, in C#, you can make a program run without the black screen appearing...so I thought: since anything you can do with .NET you can also do with Win32, maybe there's a solution.
Any ideas?
...