|
Use SetAccel()
UDACCEL accel;
accel.nSec=0;
accel.nInc=2; //take note, this is the one that does the trick.
SetAccel(1, &accel);
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" hspace="2" vspace="2">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Many thanks.
This works well (as you knew it would)
|
|
|
|
|
cgb143 wrote: Many thanks.
Nice to know that.
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" hspace="2" vspace="2">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Totally cool!
I had only ever used accelerators to 'speed up' lengthy spins. Never occured to me to use one to force even numbers.
Of course, if an odd one ever gets int here (like they enter number directly in an edit field) ... Hmmmmmmm
No shirt, no shoes, no brains, no service.
|
|
|
|
|
No it really works.
I tried starting with a 1 and it steps to 2,4,6 etc (or 0) automatically.
cgb143
|
|
|
|
|
That is neat, even (no pun intended) better
No shirt, no shoes, no brains, no service.
|
|
|
|
|
Hi-
I am new to VC++ and need help to create a UI that implements tree view to organize a .txt file (similar to windows explorer, except not dealing with folders, but rather with the internal text of the .txt file), and then be able to display the selected portion of the .txt file into the right pane of the the UI...
i.e. in the .txt file there is a date and time, log-in information, etc.--- so i want to be able to populate a tree view list on the left pane of the that has all the information seperated and organized to where i would click on a node specified (DATE/TIME) and some sort of event handler could recognize when the (DATE/TIME) node was clicked and generate that portion of the text document into the right pane of the UI.
IF anyone could assist me in getting started that would be greatly appreciated. Like i said i am very new to VC++ and for that matter C++, but if anyone could guide me and point me in the direction i need to go, that would be greatly appreciated.
I am assuming that i need to parse (which i need help to do as well) the text file first and then generate a TreeView based on the the text file. I can generate the basic UI in VS 2003 using windows form editor, however when i create a tree view in the left portion of the UI, i can't do anything with the nodes in the tree view once i create them. PLEASE HELP!
|
|
|
|
|
start with MFC and look at some of the examples on how to create a treeview.
|
|
|
|
|
Thank you i am doing that now!
Can u also guide me as to how i may want to parse the .txt file?
Thanks!
|
|
|
|
|
MFC has a file class called CFile
use that to read the file
read the text into a char buffer (make sure it's sufficiently big or read a character at a time)
use strtok to "parse" the lines
I can't be much more help than that without knowing the format of the file. However, given your first post, I am assuming there's a heirarchical nature to the text file. So, obviously each time you "descend" the heirarchy you add a child node to the treeview. And each time you ascend the heirarchy you find the current node's parent so that any new children are added to it.
If it were in XML then you could use MSXML to read and parse it.
|
|
|
|
|
Lenny P wrote: Can u also guide me as to how i may want to parse the .txt file?
Have a look at the CStdioFile class, or CreateFile() and ReadFile() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Please help me with the proper terms here. I want to run an application on startup and have it run hidden. I don't care if it shows in the task list but I don't want it visible anywhere on the desktop.
What should I be searching on? I have a console app that does what I want it to do now but I can convert it to something like a service if that's what it needs to be.
Thanks!
|
|
|
|
|
you can make it a windows application instead of a console application.
|
|
|
|
|
In other words, if you make it a windows application, but don't create a window, it will be really hidden! The task name will show up in task bar, but there will be no visible widnow.
Now, the soapbox. The Kodak EasyShare shoftware does this crap. And, every time I go to shutdown my wife's Windows XP box, I get a warning about "user has 1 program running you could lose data .. blah blah blah..." and this is very annoying, because an INEXPERIENCED user would be scrathing their head trying to figure out where is the G_____N app that is running??
So, I would also encourage you to diligently process any notifications or other events (difficult if no window..) that he system would send you regarding shutting down or logging off.
No shirt, no shoes, no brains, no service.
|
|
|
|
|
Say your application name is MyProg.Exe, and is located in C:\Program Files\My Company, then add an entry for your program in the following registry key, as follows.
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\"C:\Program Files\My Company\MyProg.exe"
Windows will run any program inside this key automatically, on startup. I dont know what kind of an app it is. If it has nothing to do with the user, then it would be better to make it as a service.
Regards,
Rajesh R. Subramanian.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Hi All,
I am a novice and would appreciate any help you guys can give me here. I want to write a code which will tell me with which window the user is currently interacting. The code I am using is
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
int test;
HWND hwnd;
MSG Msg;
TCHAR szBuf[80];
int nMaxCount;
DWORD d;
int nCmdShow;
while(1)
{
hwnd=GetActiveWindow();
if(hwnd == NULL)
{
MessageBox(NULL, "No window is currently active!","Error!" MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
test=GetWindowText(hwnd,szBuf,80);
}
}
Here GetActiveWindow returns NULL .If I use GetForegroundWindow, I get the handle of the IDE i.e VC++ and so on. How do I write a code which will tell me which is the window the user is currently interacting with?. My ultimate aim is to figure out which is the currently active window and grab images from the window. So in this case would I need to run an exe from my main code which will give me the handle to the active window? Any better idea how do I do it? Waiting for replies from the experts out there!!
-confused newbie
|
|
|
|
|
GetActiveWindow returns windows relative the the current thread, not the entire system.
From the docs:
The GetActiveWindow function retrieves the window handle to the active window attached to the calling thread's message queue.
Syntax
HWND GetActiveWindow(VOID);
Return Value
The return value is the handle to the active window attached to the calling thread's message queue. Otherwise, the return value is NULL.
GetForegroundWindow is the one you want to use. The docs say:
The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
|
|
|
|
|
Hey Ahz,
Thanks for clearing tht up!!!!. Now assuming I use GetForegroundWindow, I get the handle to the foreground window. In my case I get the handle to the VC IDE becuase thats the window I am currently interacting.I want to have a standalone application that will run in the background and give me the handle to the foreground window.. how do i do that?. Or can I launch this exe from another program. The issue is something like this...anytime a user is interacting with a window, I need to get a handle to that window and then selectively capture some graphics from that window. How do i proceed in this case? THanks!!!
|
|
|
|
|
just run your program from the Run key or place it in all-users startup directory.
Look into using SetWindowsHookEx
|
|
|
|
|
Hey Ahz, I will try using SetWindowsHookEx and see. Thanks. Can you give me a high level idea how my program should look like..I mean how do I implement it. For ex should I have a seperate application for letting me know which is the active window and should my main prog run this exe, get the handle from it (is this possible?) use the handle to grab some image from the window and then do some processing on the image...Yeah m a confused newbie so pls bear with my inane questions! THanks again!
|
|
|
|
|
wilbur_logan wrote: I want to have a standalone application that will run in the background and give me the handle to the foreground window.. how do i do that?.
Clearly, you need to write a system wide hook. Depending on your need, it may be a keyboard hook, a mouse hook, or etc etc.
Regards,
Rajesh R. Subramanian.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
-- modified at 23:23 Wednesday 21st December, 2005
|
|
|
|
|
Thanks for all the suggestions guys!
|
|
|
|
|
|
std::vector<MyClass> foo;
int someIndex = 10;
foo.erase(foo.begin() + someIndex);
-- modified at 15:40 Wednesday 21st December, 2005
|
|
|
|
|