|
I can't for the life of me figure out the simplest of problems. I am trying to capture the greatest common denominator of two integers and can't seem to get more than garbage for the output. Any algorithmic nudge in the right direction would be most appreciated.
|
|
|
|
|
If the code u have written is available, it would be easy to check why is it giving wrong output.
void (*p[10]) (void (*)());
|
|
|
|
|
int GCD(int x, int y)
{
//Swap if x < y
if(x < y)
{
int t = x;
x = y;
y = t;
}
while(x%y)
{
int r = x%y;
x =y;
y = r;
}
return y;
}
void (*p[10]) (void (*)());
|
|
|
|
|
I have an application, prog B, that starts minimized.
Another program, let's say winamp, currently has the focus.
My program - prog B should be able to retrieve the .exe name based on whichever application that currently has the focus, in this case, winamp.
I'm not sure how to go about and tackle this problem. Can somebody please help me out?
Environment - Windows 2000
Thanks in advance,
|
|
|
|
|
The GetWindowModuleFileName function retrieves the full path and file name of the module associated with the specified window handle.
|
|
|
|
|
I made a trayIcon
but, I have a problem.
Whenever I doblueclick on trayIcon
, trayicon exit.
Why?
|
|
|
|
|
For some unknown reason the ON_UPDATE_COMMAND_UI does not work in my Dialog.
Did I made a trivial fault or does this macro not operate properly in Dialogs.
Does someone has a clue, or solution?
Bert....
|
|
|
|
|
IT does not work on dialogs, as you say. Either here or on CodeGuru is a solution to the problem, it's been a while since I downloaded it so sorry for the lack of detail.....
If you can't find it LMK and I'll dig up the project where I used it for you.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Dialogs don't receive this from memory (my memory that is .
But you can catch the WM_IDLEUPDATECMDUI windows message. (I think you can also use WM_KICKIDLE too, but make sure to include afxpriv.h). Just add this to your message map in your CDialog class (after the AFX wizard stuff, but before END_MESSAGE_MAP()). Then call
<br />
void CMyDlg::OnIdleUpdateCmdUI()<br />
{<br />
UpdateDialogControls(this, FALSE);<br />
}<br />
This will call all your UPDATE_COMMAND_UI message map functions. Hope this helps...
|
|
|
|
|
Hi,
I am trying to screen capture right click context menu. I am using GetMenu, GetSubMenu, and GetMenuItemInfo APIs to capture standard application menu. Now, I want to capture right click context menu, but I don't know how to get a handle to the context menu(HMENU).
Does windows generate a window message and put it on the message queue when the right-click context menu pops up? If so, could you give me some hints how to utilize the message to get a handle of the pop-up menu. If you have any tips, pointers, or samples how to do this, could you help me. Thank you very much in advance.
|
|
|
|
|
Hi,
I am trying to capture the content of Full-screen DOS console to a bitmap file. Here are the steps I am trying.
When the user opens up DOS console window, and does ALT+ENTER to go into Full-screen DOS mode. The user then hits PrintScreen Key. This copies the content of the Full-screen DOS into the clipboard in text format.
I am able to intercept the PrintScreen Key by implementing a keyboard hook. My question is how do I convert the text format data on the clipboard into a bitmap file? Can I store the text data in a buffer, create a bitmap, and draw text data on the bitmap? Could you give me some tips, pointers, or examples how to do this? Thank you very much in advance.
|
|
|
|
|
Hi,
I am doing an entire screen capture INCLUDING THE MOUSE CURSOR. For GDI function calls, the mouse cursor is automatically hidden. Therefore, I have to get a handle of the current mouse cursor and use DrawIcon to draw it onto the screen. After the screen capture, I have to invalidate the area where the mouse cursor is drawn so the drawn mouse cursor won't stay on the screen.
I am using InvalidateRect(NULL, NULL, TRUE) to redraw all the windows, but this results in a very serious screen flickering while capturing the screen. I cannot figure out how to invalidate only the area where the mouse cursor is drawn. Could you give me some pointers, tips, or samples how to achieve this with InvalidateRect function?
Thank you very much for your help.
|
|
|
|
|
Well, that call to InvalidateRect will invalidate all windows causing WM_PAINT messages to be sent to all of them, since the HWND is NULL. And the TRUE for the bErase means that when each WM_PAINT handler calls BeginPaint (directly or by constructing a CPaintDC) the WM_ERASEBKGND message will be sent as well, causing much flicker.
It sounds like you know where to draw the icon, so I would suggest that you have all the info you need to fill in these values - which window, a RECT corresponding to the icon location, and, depending on the nature of the window, perhaps FALSE for bErase, and things will be much smoother.
|
|
|
|
|
Hi,
I have a slight problem - I have created a subclassed control which I am using a a dialog. I have enable the scrollbars and set them to the correct size etc, and have implemeneted OnHScroll and OnVScroll. However, when clicked on the scollbars don't work - as if they are just static images. Right clicking on them in Win2K and then choosing one of the options, however, does work correctly. Any suggestions?
Thanks!
|
|
|
|
|
hi to all .
i need some help on how in impleamt zooming the in my graph,
i have the following probleam:
i have a grpah i used to draw the grpah in CScrollcView class .
now i need to zoom/fouces in small part of the grpah .
and i realy dont know how .
i know that thier some articles in here and other places But there very complex
and all i need is some thing simple (one zoom only with primitive funcions).
plz help in answer or links ..
pascal sw
|
|
|
|
|
I'm hoping that I'm just overlooking an easy solution to this problem. I'm formatting some text in a CString, and need to insert newlines into that text -- I've tried using both '\n' and '\r', and their ASCII numeric equivalents. This text is then displayed in a CEdit control -- problem is, the newlines show up as those bold black boxes (the ones that usually mean "invalid character"), rather than as newlines. The CEdit/CStatic documentation doesn't seem to cover this -- is there an escape sequence I'm missing? The only way I've gotten it working thus far is to make the CString::Format() call span multiple physical lines in my code, which is a pretty hacked solution.
I'm sure this one qualifies as a stupid question, but if anyone has a solution, I'd really appreciate it. Thanks.
|
|
|
|
|
|
Yep, that was the easy answer I was missing. Thanks.
|
|
|
|
|
Hi all.
I wrote a program ...
In my program i used of MSCOMM32.OCX(ActiveX), now my program won't run in other computer !!!
I used of Release mode for compiling ...
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I found my answer ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi,
If I use:
IDRS_TEST RCDATA
BEGIN
"A String"
END
In my Resource file I can't start my app on Win98 and get an error that the .EXE is corrupt. To be precise "(Win32 Error 11)". The same stuff works fine under Win 2000.
I've tried:
"A String",0 and "A String\0" and it makes no difference.
I've searched MSDD, Google etc. to no avail.
Any help much appreciated.
Neville Franks, Author of ED for Windows
http://www.getsoft.com
|
|
|
|
|
Ok, I've found the problem. Looks like you can't use a Resource ID >= 0x8000 on Win9x but you can on W2K. I'm sure I have encountered this in the dim dark past. I thought I was going nuts. Another 5 hours lost.
Neville Franks, Author of ED for Windows
http://www.getsoft.com
|
|
|
|
|
HI all,
I want to build a buffer in visual c++ that can store 110 mb of data. And when it is full, it can write all the data in a new file.
Does anybody know how I can make this buffer, or do you have some c++samples???
Thanks in advance.
Carlos
|
|
|
|
|
I think that you are better off using a the memory-mapped file, the same architecture used by the windows swap file. There is a class that encapsulates this. I have not tried this class myself, but I use the memory mapped file extensively for in-memory databases and they are very good in performance.
http://www.codeproject.com/library/wfc/cmemoryfile.asp
has a class by Sam Blackburn that encapsulates this functionality. Looking at the page, I think it is very easy to use.
--Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
thx for replying I gone take a look.
thx
|
|
|
|