|
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
|
|
|
|
|
i was working with WS_EX_RTLREADING this option in VC 6.0 in not defined. so u should define it manually. when u use it the windows was mirrored. and all action was right to left. but this option closely was OS dependend. when u use it u should test controls such as edit box for proper operation (left align or right align text).
|
|
|
|
|
Yesterday I brought Microsoft Visual Studio 2003. But when i startet the tool today, i couldn't find where i can add controls to the dialog. Yesterday it was still there, but today i really couldn't find. I hope someone can me just tell how i get it back.
Thx for help
MFG
RedDragon2k
|
|
|
|
|
it hard get use to it
|
|
|
|
|
|
Is there a way to determine if a CEdit control's scrollbar has reach the bottom position?
|
|
|
|
|
I imagine GetScrollInfo() would do the trick.
--
If there was a problem, Yo, I'll solve it!
Check out the hook while my DJ revolves it.
|
|
|
|
|
Not if the user scrolls via the scroll thumb. In this way, the OnVScroll message is not activated by the windows framework...only by clicking the scrollbar arrow buttons.
Thank you for replying though!!
|
|
|
|
|
Has anyone worked with Installshield for Visual C++ . I basically need to create a folder in the start menu and then add a list of EXE's to it . Any help is appreciated !
|
|
|
|
|
Check out www.jrsoftware.org ... There's a free program on there called Inno Setup. (It does the same things as InstallShield). It has a wizard and you pretty much tell it the files that you want and it compiles them into one setup.exe file for you (or it can break it down). It also creates the start menu folder, desktop icons (if you desire), and uninstallation that's all automatic. It's very sweet. You can put together a full setup program complete with installation, multiple .EXE's, installation of .DLL's, .OCX's, etc in under 5 minutes!
|
|
|
|
|
I second Inno Setup, that's what we're using for our product.
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
Hi.
u can use Install Shield Express - Borland Lemited Edition that come with Delphi 6.0 install CD. i think that this is a free version. this version is fully compatible with microsoft visual c++ and so easy to use.
No Comment.
|
|
|
|
|
hello
could anybody tell me the mfc for manipulating the TIFF images??
thx
evange
|
|
|
|
|
You could start by looking at CxImage in the Bitmap & Palettes section of code project, it can open TIFF images.
INTP
|
|
|
|
|
Dear Friends,
I have a question on displaying access file information in my list box
rst.m_LoginUser(CString) & rst.m_LoginPassword(CString) are the information in the access file.
The code is
// Local Varibles
COperationRecordset rst(db);
har str [255];
// Start of the execution
rst.Open();
while (!rst.IsEOF())
{
sprintf(str,"%s\n%s",rst.m_LoginUser,rst.m_LoginPassword);
SendDlgItemMessage(hWnd,IDC_System,LB_ADDSTRING,0, (LPARAM)str);
rst.MoveNext();
}
rst.Close();
Regards,
Anson Tong
|
|
|
|