|
THANKS!
That did it!
I'd been expecting that dang DefWindowProc to do this...
I mean, it does it for keydown (or something) so why not mousedown???
Oh well. It works and I'm off to make the thing DO somethin now
THANKYOUUUUUUUUUUUUUUUUUUUUUU !!!
...Steve
|
|
|
|
|
Hi, sorry in advance to those who may find this a dumb question.
I have the peak values of a wave file displayed in a frame in my dialog box. I want to have a line running across the waveform when the file is playing. I'm thinking that it's quite a hassle to have to use GDI to draw a line at a particular point, then erase and redraw at another point at every seconds of playback. While thinking of ways to avoid the trouble of having to call SetROP2 so many times, I thought of using a caret.
Question: Is a caret even possible in such a situation?
|
|
|
|
|
Well, this won't be much help, but if you can do it, it's possible
I guess the prob with drawing the line is undrawing it, eh?
SetROp (hdc, R2_NOTXORPEN); // <-- YOUR FRIEND
If you go with the caret approach, you'll either have to use the same SetROp xor
biz or else reserve room for the caret in your (probably) custom control...
In any case, it's not the drawing, it's WHEN to undraw that's the tricky part.
If you figure it out, lemme know...
I've got an app doing the same thing and occasionally it doesn't "undraw"...
...Steve
|
|
|
|
|
I have some code that renders multiple lines of text using a mono-spaced font (like Courier New, or Lucida Sans Typewriter).
The UI draws the text in an area of no more than 24 lines by 80 characters wide.
The font to draw this text is calculated so that it fills up as much of the current view rect as possible, so resizing the window causes the font size to get larger or smaller.
In Win2K I can resize the window such that there is no extra space at the edges, and on my machine in XP I can also do this. However on several of my users machines, in XP, they cannot do this, resizing will always cause the font size to jump up or down such that there's space left over at the edges.
I'm using the CDC::GetTextMetrics to get the font/text sizes.
Why would I see different text performance, using the same font name/family between Win2K and even between XP installs?
All versions of XP are identical in terms of the build/sp number (as reported by running the "winver" command).
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
I have noticed different font sizing (exactly the same face and point size) due to XP's ClearType being turned on or off. It seems that ClearType tends to render the font smaller than old W2K without ClearType.
onwards and upwards...
|
|
|
|
|
Yeah I thought that might be the case too. So I checked this in the Display options and tried with it turned on and turned off. It made no difference on my machine at all.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
You may want to use GetCharABCWidths to calculate the sizing for the width. Also, are you subtracting any scrollbar area, borders or 3D bevel edge sizes (GetSystemMetrics())? These can be different with the new XP themes.
onwards and upwards...
|
|
|
|
|
Hi,
I'm trying to bring the window of Excel to the foreground. I've tried SetForegroundWindow(), but don't work. I tried SendMessage(), but it seems too complicated to me.
What should I do? I have the hWnd of the excel application, I'm sure it is possible.
Also, where can I get more information on how to send messages to other windows, like submitting mouse clicks and key inputs, much like Sendkeys of VB? When I google "Windows Programming", I only get those discussing message loops, Windows proc etc, but not much about the message sending thing.
Thanks in advance.
Regards,
David Chan
|
|
|
|
|
im_chc wrote: I've tried SetForegroundWindow(), but don't work.
Does your applicaton meet all of the requirements described here?
im_chc wrote:
What should I do? I have the hWnd of the excel application, I'm sure it is possible.
How was the Excel window created?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
Does your applicaton meet all of the requirements described here?
I'm not sure, but probably it isn't because "The process was (not) started by the foreground process(my program)".
Yeah, I read that too, that's why I ask the question here for alternatives other than SetForegroundWindow, or for stuffs that fix the problems that make setfgwindow fail.
DavidCrow wrote:
How was the Excel window created?
Actually my code makes Excel run, I use getObject to get the COM object of an Excel Application (say xlApp), and set xlApp.visible to true.
I got hWnd from the xlApp object itself (xlApp.hWnd).
-- modified at 12:40 Sunday 22nd January, 2006
|
|
|
|
|
Hi ,
If you have created the excel through code then you can actually ask the COM interface to give the user the control and make it visible(if not visible),
Check this link also regarding Messages :-
http://www.flounder.com/messaging.htm[^]
Following code sets the yahoomessenger in the forground
HWND hwnd = ::FindWindow (NULL,"Yahoo! Messenger with Voice");<br />
::SetForegroundWindow (hwnd);
Regards,
FarPointer
|
|
|
|
|
Hey thanks! It is a very detailed page on Message API.
However, I have a question. In the article, it said one shouldn't "fake" the system by submiting event msgs like "WM_LBUTTONDOWN", coz I have to make sure that "all the rest of the system state is correct".
However, if I want to do automated testing, and I want to simulate the user's GUI input(just like what the Rational Robot does), I wonder if it is ok for me to do such faking? I mean, would it be very troublesome to achieve that said "all the rest of the system state is correct"?
Or, only better, is there any existing open source automatic GUI testing framework available? I don't mean those xUnit Unit testing frameworks, I mean the GUI ones and provide an API for doing things like getButton(buttonID).click, getWindow(windowID).GetCombo(cboID).selectItem(1), much like the SQABasic scripts?
Thanks!
-- modified at 12:40 Sunday 22nd January, 2006
|
|
|
|
|
I've made this work but I'm wondering if there's a better way that I'm overlooking.
So, I've developed a sub-class of a CEdit control in a development environment. I've got the two files MyCEdit.cpp and MyCEdit.h sitting in a directory of my development environment. My latest and greatest (at least most time consuming) project needs to use the new class object. I can't use New Class because that means I have to start from scratch. I can't add the class from a type library coz it isn't in one. So all I can do, and have done, is include the two files in my project. At this point the class wizard doesn't appear to know that CMyCEdit exists. Under Member Variables/Add Variable the Variable Type doesn't know that I've just introduced CMyEdit. I include MyCEdit.h in the ??????Dlg.h file and no difference.
In order to make the class appear in the class wizard I have to make sure that the class header file is #included in either the dialog or view header. I then delete/rename the .CLW file, invoke the class wizard which then offers to rebuild the class data from the files involved.
Certainly there has to be a better way to do this more directly through VC++.
TIA,
Lilith
|
|
|
|
|
Lilith.C wrote: Certainly there has to be a better way to do this more directly through VC++.
Not necessarily. Deleting a project's temporary files (e.g., ncb, opt, clw, aps) is actually quite common.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
hi to all
My Problem:
1.My prject security component(name: RATX) not able to recognize a non-NT domain
2.When USUSER domain(my one domain name) Local group is used , the RATX securtiy component does not work.
Before that this organization worked with NT. Now they are using XP.
suggetions required.....
OS:NT4
middleware:C++
database: SQL
Bhasker P
think...........not get idea
search code project.....
-- modified at 11:33 Thursday 19th January, 2006
|
|
|
|
|
So what exactly is your question?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
How can I check if a device is connected to my serial port?
Using CreateFile on COM1 I can get a HANDLE to the file, but I don't know how to use that to tell if something is actually connected.
Thanks!
Kelly Ryan
|
|
|
|
|
Send some command to ur device. if it did not respond then its not working either connected or not connected.
-Prakash
|
|
|
|
|
The problem is that I know basically nothing about the device. I was hoping there was a generic WinAPI command or something that I could send to see if it was responding, like a ping or whatnot.
Kelly Ryan
|
|
|
|
|
but i am not sure if createfile will succeed if the device is not connected to the com port.
-Prakash
|
|
|
|
|
CreateFile should succeed as long as there is a COM port. The only problem you will have is if the COM port is already being used by another application. If it is, CreateFile will fail. If the COM port does not exist, CreateFile will fail.
What exactly do you want to detect is on the COM port and why?
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
You have to get informations regarding the device connected to your COM port. Otherwise there is now way to detect the device is connected or not. But in case of USB device, u can get information of USB device connected without knowing the details.
|
|
|
|
|
This is just a guess, but does the following help:
OVERLAPPED ov = {0};
HANDLE hCom = CreateFile("COM1", ..., FILE_FLAG_OVERLAPPED, ...);
SetCommMask(hCom, EV_CTS | EV_DSR);
o.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (WaitCommEvent(hCom, &dwEventMask, &o))
{
}
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
I was able to use this in a separate thread along with a timer to accomplish what I needed, thanks!
Kelly Ryan
|
|
|
|
|
Hi all,
I want to use __asm int 21h in the visual c++ but I can't.
How can I do that?
Please help me on this.
Thank you.
Every new thing you learn,Gives you a new personality.
|
|
|
|