|
Is it possible to let a user draw his own button at runtime? I mean to say,that the button size be varied with its position also at runtime.
Actually,my project work needs to make a toolbar analogous to "Micrsoft Paint"'s toolbar in which there will be button tool which a user can use to make a button in his workplace.It will be more suitable if the button is circular rather than rectangular as seen normally in VC++ .
|
|
|
|
|
Yes, it is possible. If you want to draw your own type of button that's circular that's possible too. Don't expect code here though, that's pretty much beyond the scope of a forum thread, just read up on owner draw buttons for the circular button question. For resizing the button, you will need to just code some way for the user to resize it, put it in some custom view or something and handle the mouse events, you can call MoveWindow() to resize the button.
-- Rocky Dean Pulley
|
|
|
|
|
In Win32 is there an easy way to query the top n windows on the screen by Z-Order and get their handles?
Joel Holdsworth
Wanna give me a job this summer?
Check out my online CV and project history[^]
|
|
|
|
|
Have you tried using EnumWindows()? I can't remember off the top of my head whether or not it goes by Z Order, but I think it may.
-- Rocky Dean Pulley
|
|
|
|
|
Try Combination of FindWindow and FindWindowEx .
here is small piece of code,please Check Is it suit your requirements.
BOOL NMPEnumWindows(CStringArray *arWindowsName,CPtrArray *arhWnd)
{
<font color=#008000>
HWND hWnd,hWnd1=NULL;
CString Str;
char lpString[201];
<font color=#008000>
hWnd=::GetDesktopWindow();
<font color=#008000>
do
{
hWnd1=::FindWindowEx(hWnd,hWnd1,NULL,NULL);
<font color=#008000>
::GetWindowText(hWnd1,lpString,200);
Str.Format("%s",lpString);
<font color=#008000>
</font>
If((::IsWindowVisible(hWnd1)==TRUE)&&(Str!=""))
{
arhWnd->Add((HWND)hWnd1);
arWindowsName->Add(Str);
}
}while(hWnd1!=NULL);
return TRUE;
}
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
|
Hi Joel,
i just surfing you site and come across
The Bible in an HTML Help File
could i borrow that for reading.
thanks
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I am writting a C++ application.
There is a long running processing in the application. While it is doing something, if I move any "windows" on top of the application. the applicaiton become "blank" -- no message shows on UI. How can I refresh the UI of application?
|
|
|
|
|
You need to put your "something" in a separate thread so that the main thread can still process paint messages.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
"a long running processing" refer to in a while loop. the interation can be from 0 to 10K. I found whenever the application is inside that code section and if I move another windows on top of the application, then the UI is wiped out.
|
|
|
|
|
You can try something like this....
for (int i=0; i
|
|
|
|
|
See "Responding to user input while performing a long task" in this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
hi
i am not very clear with u r situation ,In case u just want to refresh something i dont think its a bad idea to use InvalidateRect().
hope this is of some help to u..
regards
udaykumar
|
|
|
|
|
I have a program that brings up two dialog windows, I would like them to overlap and appear in a tab like manner much like an index, so when you would click on the tab for the window to appear. My question is how to accomplish this. Thanx in advance, and forgive this if it seems elementary.
Ken
|
|
|
|
|
Why not just use a real tabbed dialog rather than a faux one?
http://www.codeproject.com/tabctrl/
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hey. I finally figured out a way to put a checkbox on top of a button. In the toolbox, select Owner Draw to be true. But now if I create a variable associated with the button (later on in the application i have to hide the button) it causes the program to crash.
Any of you know the proper way to prevent buttons with Owner Draw set to true to prevent from crashing.
thanks,
-akbar
|
|
|
|
|
I found a way around it
GetDlgItem(BTN_NAME)->ShowWindow(0);
but I still need a skinnable button that I can lay the checkbox control ontop of it :/
|
|
|
|
|
Hi - I'm looking for a good description or sample code for how to get data from a USB device (say a still image camera) into a visual c++ app. I've seen hints about using TWAIN, or using plain old file io, but not enough detail anywhere to Make It So. Plenty about driver development, but nothing about app-level. Any links or suggestions appreciated.
- Thanks, Barney
|
|
|
|
|
hi,
At application level, the device(bus interface.ie,usb,pci,pcmcia is not bothered, all are just treated as a common image rendering interface) is abstrated, and you look it as an interface(still image rendering interface)...You would look into WIA in the mdsn which will give you information about the your requirement...
TssP
|
|
|
|
|
|
I have a stored procedure on a MSSQL2K server that will perform 2 processes. I am doing a check of the processes and will return an int value which specifies whether the processes completed properly, i.e.
return val - Meaning
0 - both processes failed
1 - the first process completed but the second failed
10 - the second completed but the first failed
11 - indicates both passed
The SP uses the return keyword as in:
<br />
USE myDB<br />
IF EXISTS (SELECT name FROM sysobjects <br />
WHERE name = 'updatedata' AND type = 'P')<br />
DROP PROCEDURE updatedata<br />
GO<br />
USE myDB<br />
GO<br />
CREATE PROCEDURE updatedata <br />
@n1 decimal,<br />
@n2 decimal,<br />
@n3 varchar(25),<br />
<br />
AS <br />
<br />
set nocount on<br />
<br />
DECLARE @m1 int<br />
DECLARE @m2 int<br />
<br />
... do initial process ....<br />
<br />
select @m1 = (select count(*) from table <br />
where params match)<br />
<br />
... do second process ...<br />
<br />
select @m2 = 10 * (select count(*) from table <br />
where params match)<br />
<br />
return (@md + @mdh)<br />
<br />
GO<br />
<br />
using following the TSQL string in query analyzer returns the results correctly:
<br />
declare @val int<br />
exec @val = updatedata 101002, 105041, 'some part number'<br />
select @val as 'val'<br />
In VC/C++, I am using ADO and the open function to call the SP. I need to know how to format the syntax so the return value is returned to be evaluated.
Considering using this function:
<br />
char rsSQL[256];<br />
sprintf(rsSQL,"exec updateData %d, %d, %s", (long)tme, (long)jdt, cmLITM);<br />
RS1->Open(rsSQL, vtMissing, adOpenKeyset, adLockBatchOptimistic, -1);<br />
How can I change this to get the data returned correctly?
Thanks in advance.
There are 10 kinds of people, those that understand binary and those that don't.
|
|
|
|
|
I use Visual C++ to program.
Can I delete one character in one file without use a tempFile? And How?
For example,
- my file contains: "Life is so short";
- the file pointer is at the beginning of file
- after I open file for reading & writing, the file contains "ife s o hort";
thanks
do not understand everything
|
|
|
|
|
six_billion wrote:
Can I delete one character in one file without use a tempFile? And How?
Yes. In summary:
Open file for reading
Read entire file into buffer
Close file
Locate and delete character from buffer
Open file for writing
Write buffer to file
Close file
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
well, you open the file, read the data, close the file, modify the data and write back the data into it.
you can't directly modify a file. ( afaik ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|