|
when i did this sort of thing i always used a list control
then just added the new string at the top or the bottom depending where i wanted it to scroll
"there is no spoon" biz stuff about me
|
|
|
|
|
I have a problem with using _inp & _outp in windows 2000 .
when I this instructions Execute, windows prompt this error message :
The exception Privileged instruction.
how can I get Privilege For process to solve this problem.
(I'm so sorry for my English )
Iman Ghasrfakhri
|
|
|
|
|
These are kernel-mode instructions that can't be called from a user-mode application. They are typically called by a device driver (which runs in kernel mode).
Nick Hodapp
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2003 Microsoft Corporation. All rights reserved.
|
|
|
|
|
you mean its imposible ? to use this instruction ?
Iman Ghasrfakhri
|
|
|
|
|
|
hi,
if i drag an objekt from my CScrollView window to the top of the area of a scroll bar, i want the view to scroll automatically in the same direction.
Could you plz tell me how to do it?
Thanks!
withoutdruck
|
|
|
|
|
Normaly you should set timer, when in drag mode and cursor x pixels from top; and then inside OnTimer handler scroll window.
Brian
|
|
|
|
|
Thanks Brian.
But when I tried to identify the runtime class according to the cursor position, it told me always it was of the same CSrcollView class, although the cursor was just above the scroll bar.
|
|
|
|
|
how do i set up a floating toolbar so that it will be displayed vertically? (all buttons displayed in column, not in row)
|
|
|
|
|
// in your CMainFrame class, create a CToolBar
// that includes the TBSTYLE_WRAPABLE and
// CBRS_SIZE_FIXED flags.
// next, call the SetRows() method. have a look
// at the MSDN docs for a full desciption of the
// method and its parameters.
int numRows; // TODO: initialise this value
m_wndToolBarFloat.GetToolBarCtrl().SetRows(numRows, true, 0);
// last, dock the tool to the left or right side
// of the MDI frame
m_wndToolBarFloat.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBarFloat);
|
|
|
|
|
Hi,
I would like see if I can get the system date in a few lines of code?
any ideas?
Thanks
Ehsan Behboudi
|
|
|
|
|
look up time_t in the MSDN.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
#include <time.h>
time_t now;
struct tm *newtime;
char todaysDate[128];
// get the number of seconds since January 1, 1970
time(&now);
// get the current system date
newtime = localtime(&now);
todaysDate = asctime(newtime));
|
|
|
|
|
If using MFC,
COleDateTime dt = COleDateTime::GetCurrentTime();
Regards,
Alvaro
He who laughs last, thinks slowest.
|
|
|
|
|
Its very Simple.
SYSTEMTIME systime;
GetLocalTime ( &systime );
then
systime.wDay is the Day
systime.wMonth is the month and
systime.wYear is the year.
itn't it cool ?
Best Regards,
Jijo.
The nice thing about standards is that there are so many of them to choose from.
|
|
|
|
|
I have to get all the child windows from my main window. Once I have the hwnd How do I find out which window it is, I know I can call GetClassName on the hwnd but that's not good enough for me because most of my windows don't have names, I tried calling GetDlgCtrlID on the hwnd but it crashes because my hwnd is just enumerated. So what can I call to get either the resource ID of the window or some other information that will tell me which window it is. The following is the code I wrote to get the windows:
if(!EnumChildWindows ( AfxGetMainWnd()->m_hWnd, EnumChildProc, NULL))
{
TRACE("Unable to get child windows???\n");
return;
}
BOOL CALLBACK CMyDlg::EnumChildProc(HWND hwnd,LPARAM lParam)
{
TRACE ("Enumerated Child Window : %x\n", hwnd);
}
Is there some other function besides EnumChildWindows that can be used & will give me more useful data?
Thanks in advance
|
|
|
|
|
There are plenty of ways to accomplish this...
You can iterate with GetWindowTop, GetNextWindow;
To get class name: GetClassName
If you are the one creating them make all windows support some protocol:
make them all respond to some message like "WM_APP+100" with some value, or use existing message such as WM_GETTEXT.
If not, install some hook via InitCommonControlSex....
Anyway... good luck
|
|
|
|
|
Hi Rgarf!
I am also exploring same area in which U are dwelling. Hope we both us have something for each other. Just be in touch.
The solution to Ur problem is Use FindWindow and FindWindowEx.
What my problem is if there are two edit controls in the same window how to uniquely identify them. Please, reply me if U knw. U can mail me in to_siddharth@indiatimes.com.
Cheers!!!!!!
Siddharth
|
|
|
|
|
Is it possible to attach a standalone scrollbar control to an edit control to overcome CEdit's inability to inform you of the scrollbar position? Why would they do that anyway?? Allow you to display a scrollbar but not retreive any of it's information?
|
|
|
|
|
How can I make a filled rectangle on the screen transparent using alpha blending. Any ideas?
Thanks
|
|
|
|
|
I believe W98 onwards has an AlphaBlend function. I also presented one in Windows Developers Journal a couple of years ago, if you look on their site for alphablend, you're sure to find it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi all,
I have an MDI application. On selecting a menu item I open up a new document using CreateNewDocument(). But when I save the document, it shows illegal operation. I chose Full Server option for Step 3 of AppWizard, default file ext as ".d" in step 4 and CFormView as base class. My document is derived from COleServerDoc, by default. The code I tried for opening the document is below.
CTestView::OnMenuItem1()
{
CString s = ".d";
CTestApp* pApp = (CTestApp*)AfxGetApp();
CMultiDocTemplate* pDocTemplate = pApp->GetDocTemplate(s); //defined in CTestApp
if(!pDocTemplate)
return;
CTestDoc* pDoc = (CTestDoc*)pDocTemplate->CreateNewDocument();
pDocTemplate->SetDefaultTitle(pDoc);
CFrameWnd* pFrame = pDocTemplate->CreateNewFrame(pDoc,NULL);
pDocTemplate->InitialUpdateFrame(pFrame,pDoc,TRUE);
}
CMultiDocTemplate* CTestApp::GetDocTemplate(CString& sType)
{
CMultiDocTemplate* pDocTemplate;
POSITION pos = GetFirstDoctemplate();
while(pos)
{
pDocTemplate = (CMultiDoctemplate*)GetNextDocTemplate(pos);
CString ext;
if(pDocTemplate->GetDocString(ext,CDocTemplate::filterExt))
{
if(ext == sType)
return pDocTemplate;
}
}
return 0;
}
Why am I not able to save this document? The same code works well for MDI applications with CSrollView and CFormView base class and None option for Step 3 of AppWizard.
regards
kevcs2
|
|
|
|
|
How do i terminate an application programatically from another program that i know is mine ?
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
If you have the handle to the application, use this Windows API function:
BOOL TerminateProcess(
HANDLE hProcess,
UINT uExitCode
);
See MSDN for more.
Hope that helps
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hi,
is just using WS_EX_RTLREADING for control enough to use right-to-left reading order or there's some more code to add? Do I need to use WS_EX_RIGHT as well?
Is WS_EX_RTLREADING automatically used when the OS is using right-to-left reading order? If I add this style with an OS in english, controls will display text in left-to-right order. I guess that only r-t-l is triggered automatically?
Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|