|
I want to change the scroll lines number in Windows98(system wide).
But it does not work. Could you please give me a hand ?
Below is my code:
int num = 10;
SystemParameterInfo(SPI_SETWHEELSCROLLLINES, num, NULL, NULL);
The same code works in WinMe, Win2000 and WinXP.
Could you please give me your ideas?
Thanks for your help.
|
|
|
|
|
i am having problem in loading a bitmap in a rectangle contained in a dialogbox. anybody having idea what to do or any sample code
|
|
|
|
|
I generally make a CStatic box with a border and then create a new class which is a child of CStatic. For example, class CBitmapViewBox : public CStatic
I add a member variable of type CBitmapViewBox to my main dialog and, in the OnInitDialog() event, I do this...
<br />
m_BitmapViewBox.SubclassDlgItem(IDC_SBITMAPDISPLAY, this);<br />
m_BitmapViewBox.Init();<br />
To load and display the bitmap, I do this...
<br />
void CBitmapViewBox::OnPaint() <br />
{<br />
CPaintDC dc(this);
CMainViewDlg *pWnd = (CMainViewDlg *)GetParent();<br />
<br />
if(pWnd != NULL)<br />
{<br />
if(m_bValid)<br />
{<br />
CRect lRect;<br />
GetClientRect(lRect);<br />
lRect.NormalizeRect();<br />
<br />
BITMAP bm;<br />
m_BMP.GetBitmap(&bm);<br />
CBitmap *pOldBitmap = dcMem.SelectObject(&m_BMP);<br />
<br />
dc.BitBlt(0, 0, lRect.Width(), lRect.Height(), &dcMem, 0, 0, SRCCOPY);<br />
<br />
dc.SelectObject(pOldBitmap);<br />
}<br />
else<br />
{<br />
dc.DrawText("Not a valid BMP file", -1, lRect, DT_CENTER | DT_VCENTER | DT_WORDBREAK);<br />
}<br />
}<br />
<br />
CStatic::OnPaint();<br />
}<br />
<br />
BOOL CBitmapViewBox::UpdateBMP(LPCTSTR lpszName)<br />
{<br />
CMainViewDlg *pFrameWnd = (CMainViewDlg *)GetParent();<br />
HBITMAP hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), lpszName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);<br />
<br />
m_bValid = TRUE;<br />
<br />
if(m_BMP.DeleteObject())<br />
m_BMP.Detach();<br />
<br />
if(!hBitmap)<br />
{<br />
m_bValid = FALSE;<br />
UpdateSize(m_iMaxWidth, m_iMaxHeight);<br />
Invalidate(TRUE);<br />
return FALSE;<br />
}<br />
<br />
m_bValid = TRUE;<br />
<br />
m_BMP.Attach(hBitmap);<br />
}<br />
|
|
|
|
|
Is there a good book on this planet about the core WINApi, how it works, and how I can work with it. I have to use the ol' famous help or MSDN, but I'm wasting paper on it (Printing), and it's not always that clear (No samples, etc...)
Sjoerd
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
there is a good book in the market its something like Win32API programing with visual basic and does have samples
live and let them live
|
|
|
|
|
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
I bought Petzold after I found some PDFs. I ordered and got suprised how big it is, recommended if you need old school WinAPI.
|
|
|
|
|
At Amazon?
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
please google your question:
http://www.google.de/search?q=petzold
|
|
|
|
|
how to pass a memDC from view class to an activeX controls method which is created dynamically in the view
|
|
|
|
|
i have form view with size larger than that of a screen size with scrollbars. i am creating ActiveX components dynamically at runtime on this view. i want to extract all these components in to a bitmap for printing. but when i am trying to do so my bitmap is having only the components which are present in the visible client area of the form view. is there any way to get the drawing of the componets that are present in the not visible area of the view or is there any other method to print my form view with activeX components that donot completely fit into the visible client area.
|
|
|
|
|
Hi,
In a dialog based application, i have a child dialog which should be arranged
by the resize and splite control.
The dialog have the following components:
(1) Some buttons created by MFC class winzards.
(2) Two FormView controls, the one a place holder for showing something such as graph, image ..., and the another one is a list control.
Now, my problem is:
I can resize the whole window by using a class called CResizableDialog and all the control components created by MFC resource editor are works correctly.
But the components created by the Formview drived class cannot be resized.
I need your any ideas about this hybrid cases.
Thanks in advance!
chen
|
|
|
|
|
Hello,
I am writing program on Pocket PC using mfc and want to get rid of the default upper right OK button. I have tried the SHDoneButton API. The OK button does disappear but then there is a cross button. Is it possible to make the upper right corner clean?
|
|
|
|
|
Hi,
What is the command equivalent FileCopy(in VB) in VC++ for copying files.
With regards
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
|
i want a dlg based appln to be displayed as an icon.i don't want the appln
to show dialog.can u help me..
|
|
|
|
|
An icon where ? Why ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
when i run the appln i want it to go to desktop as an icon
|
|
|
|
|
How odd.... You want to create an icon, but it won't be a normal desktop icon that runs the program, this icon will mean the app is running ? Will it behave like a normal icon ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
sorry!!!!i meant to create an icon that will go to desktop or anywhere but user shouldn't know that appln is running
|
|
|
|
|
So I don't get it. This thing will run in secret ? Why create an icon when it runs at all ? The icon is the hard bit. I presume you don't want the program to be on the task menu then ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
yes,i don't want it in the task menu.i want the pgm to run secrettly without user knowing
|
|
|
|
|
Anonymous wrote:
i want the pgm to run secrettly without user knowing
Why ? Is it a virus, or is it spyware ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
it is not virus but a little bit of spy work.do tell about icon
|
|
|
|
|
I think it would be fair to assume that you won't get an answer after admitting that you're trying to write spyware
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|