|
|
Just read about this function - The SetWaitableTimer function activates the specified waitable timer. When the due time arrives, the timer is signaled and the thread that set the timer calls the optional completion routine.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Hi all
I have a problem with scaling a bitmap in different DPI situations .
The problem is : I have a dialog box where a bitmap is statically present . So during runtime without calling LoadBitmap () this bitmap is loaded into the dialog with the default size which is same you see in dialog editor . But problem comes when I change system DPI from 96 to 120.
Now the dialog and all the controls behind the bitmap are resized while the bitmap remains the same. I tried to implement StretchBlt () to scale the bitmap to new size - I do not succeed as I do not know how to map it to new DPI . To pictorise it ...
................. <---- The parent dialog
. .
. |---------| .
. | |<-- Bitmap with original static size when DPI=96
. | | .
. | | .
. | | .
. | | .
. | | .
. |---------| .
. .
.................
Now what I want is , when I change DPI to 120 then it should resize itself *from* the top,left of original size to the new sized bitmap .
After implementing StretchBlt as below ..I got it stretched fully to windows limits not as I want ...
pBitmap->LoadBitmap(IDB_BITMAP_ADDON_10_NOE);
POINT ptSize;
GetClientRect(hDlg,&rect);
pBitmap->GetObject(sizeof(BITMAP), &bitmap);
ptSize.x = bitmap.bmWidth;
ptSize.y = bitmap.bmHeight;
fxFactor = ((float)ptSize.x/(float)(rect.right-rect.left)),
fyFactor = ((float)ptSize.y/(float)(rect.bottom-rect.top));
xOffs = ((long)rect.Width()-(long)(ptSize.x/fxFactor))/2;
yOffs = ((long)rect.Height()-(long)(ptSize.y/fyFactor))/2;
dc->StretchBlt(xOffs,
yOffs,
(long)(ptSize.x/fxFactor),
(long)(ptSize.y/fyFactor),
&dcTemp,
0, 0,
ptSize.x,
ptSize.y,
SRCCOPY);
Now we have the real width,height of the bitmap + the windows dimensions . I need the bitmap to be scaled evenly to the new dimension of dialog keeping this bitmap in the center of the dialog . So I need to calculate the coordinates of the new bitmap with following points
1) Coordinates of the windows( = Center point of window)
2) Height,Width of bitmap
Can anyone please advise me ?
redindian
redindian
|
|
|
|
|
I see you use of StretchBlt why it doesnt work?
------------ ------------ ----------
1)CRect Rect; GetWindowRect(&Rect);ScreenToClient(&Rect);
2)BITMAP bm;GetObject(handle to bitmap,sizeof(BITMAP),&bm);
|
|
|
|
|
Hi
Thanks for your several answers . In fact I use StretchBlt - but I am doing something wrong in calculating the offset , so the bitmap is stretched to the extreme limits of the dialog . I want the ratio between the size of the static bitmap and the dialog to be evenly increased so that the bitmap is not stretched to the limits. I am unable to calculate the coodinates .
Could you tell me how I can arrive at it with following inputs. I have the following
1) Static size of the bitmap - height/width
2) GetWindowRect(&rect)
I want to get the increased coordinates of the bitbap with the ratio maintained between the new size of bitmap to the new size of dialog .
I hope I do not confuse you . Please try to tell me how I calculate it
redindian
|
|
|
|
|
For example you can use of
(GetWindowRect/ScreenToclient) for retrives dimessions of the window and now you have left/right/top/bottom of window(Rect) now you can calculate these dimessions for bitmap <br />
<br />
<div class="ForumSig"><div style="padding: 0; margin: 0; background-color: rgba(170, 214, 255, 1); text-align: center; font-family: Arial; font-weight: bold; font-style: italic; font-size: 9pt"><br />
<div style="color: rgba(255, 255, 255, 1); width: 300px"><br />
<hr width="250" size="7">WhiteSky<hr width="220" size="7"></div></div></div>
|
|
|
|
|
Does your problem solve?
|
|
|
|
|
Hi Friends,
In my project, i am using DLLMain method.And also i am setting optional entry as DllMainCRTStartup.inspiteof these i am getting below errors.Anybody can help me regarding this?
Creating library C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.lib and object C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.exp
LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.xnt : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Raghavendra Pise
|
|
|
|
|
|
I had used some Property Sheets in a Project
which is resulting in a Memory Leak , I dont
know why its occuring ? can anyone put some
light on it
Vikas Amin
EATON
PUNE
|
|
|
|
|
|
Memory leaks are caused by calling new without calling a corresponding delete .
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
vikas amin wrote: ...which is resulting in a Memory Leak
How are you verifying this?
vikas amin wrote: I dont
know why its occuring ?
Neither do we (with a description like that).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
I used CListCtrl to create virtual list. I set LParam field in virtual list, but it not working properly. Kindly help
I also need to sort the list
KK
|
|
|
|
|
This a very well known and common problem. See microsoft knowledge base article 555375 here[^] for more information.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Love it!
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi guys.
I have a problem. I want to delete/remove some character in the file; for example I want to remove 10 bytes of character from specific file.
Thanks.
|
|
|
|
|
Hi Mohammad
Use 2 files, one original file and another temperory file.
Copy wanted bytes from original file to temperoroy files and remove original file. Rename temperory file to original file's name
Best of Luck
Regards
KK
|
|
|
|
|
I couldn't use as this way.Since I have a file in the size of 500MB and every time I want to insert, update and delete some character from file.If the file size is small,I absolutely use this way, but for large-size files couldn't.
Thanks for your help.
Affectionately.
Truely yours.
|
|
|
|
|
Mohammad Khodaea wrote: ...but for large-size files couldn't.
Why not?
If a second, temporary file is not possible, do the insert/update operation(s) in memory, and then write to the same file.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
i'm a newbie in the coding world. Now i'm facing with a trouble that how can i collect all window class name kinds (like WindowsForms10.Window.8.0.2bf8098,WindowsForms10.Window.8.app.0.2bf8098, WindowsForms10.Window.8.app.1,WindowsForms10.Window.8.app.2..etc.). Because i have a capture tool and i want to map the windows or controls have winclass and wintype with myself definition class like the example below:
winclass wintype myclass
Ex: WindowsForms10.BUTTON.appb checkbox checkbox
But my problem is the <hexappdomainhash> element ('appb' in above example) in window class name form maybe change,it's not stable. So i cannot have the general way in my mapping.
Have anyone please show me where i can collect all of window class name kinds?
best regards,
khuong.ngo
|
|
|
|
|
khuong.ngo wrote: Have anyone please show me where i can collect all of window class name kinds?
Use GetClassInfo(NULL, ...) .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I would like to know how to force the output of command "tasklist" to a file?
(I launch the command "tasklist" by WinExec!)
Please help!
|
|
|
|
|
LaHaHa wrote: I would like to know how to force the output of command "tasklist" to a file?
(I launch the command "tasklist" by WinExec!)
I guess WinExec is deprecated, right?.
You can use the following command to dump output from tasklist to a text file...
cmd /c tasklist >> C:\nibu.txt
|
|
|
|
|