|
I developed one Schduler application ,
In which I used OnTimer() function to popup the messages to
a particular given time.
Cursor is blinking when the application is running.
When I move the cursor on to appli it is blinking .
Plz Give Solution very Urgently.
Praveen Chowdam Kumar
|
|
|
|
|
Can you show code of OnTimer and OnPaint with details?
|
|
|
|
|
n
CString sql,sDate;
/*CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
CMyTabExampleApp *pApp = (CMyTabExampleApp *)AfxGetApp();
*/
CDatabase db;
db.OpenEx("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\mydabase.mdb;DSN=MyDsnName",CDatabase::noOdbcDialog);
CRecordset recset( &db);
CTime t;
CTime s=t.GetCurrentTime();
CString strDate,strTime;
strDate.Format("%d-%d-%d",s.GetDay(),s.GetMonth(),s.GetYear());
strTime.Format("%d:%d:%d",s.GetHour(),s.GetMinute(),s.GetSecond());
sql = "select TaskType, TaskDetails, StartDate,SnoozeTime from mytable where StartDate ='"+strDate+"' and SnoozeTime = '"+strTime+"'";
recset.Open(CRecordset::forwardOnly,sql,CRecordset::dynaset);
//MessageBox("READING DB");
CString tasktype,taskdetails;
while(!recset.IsEOF())
{
recset.GetFieldValue("TaskType",tasktype);
recset.GetFieldValue("TaskDetails",taskdetails);
recset.MoveNext();
MessageBox(tasktype + "\n\n"+ taskdetails);
if(tasktype=="APPLICATION")
{
CSnoozeAppli objappli;
objappli.sTaskDetails = taskdetails;
objappli.DoModal ();
}
else
{
CSnoozeMsg dlg;
dlg.sTaskDetails =taskdetails;
dlg.DoModal();
}
}
db.Close();
SetTimer(100,1000,NULL);
CDialog::OnTimer(nIDEvent);
Praveen
|
|
|
|
|
I have application that scans for files (exe's and dll's) and looks up thei import table.
I have managed to see what functions they import with IMAGE_NT_HEADERS IMAGE_IMPORT_HEADERS IMAGE_THUNK_DATA.
i compare the c***ion pointer from
pThunk->u1.FisrtFunction with my function loaded with GetProcaAdress()
it works fine but how do I get the function name from IMAGE_THUNK_DATA structure
i've tried
WORD hint=(WORD)&pThunk[l]->u1.AddressOfData->Hint;
PSTR FNAME=(PSTR)((BYTE *)hMod+pThunk[l]->u1.AddressOfData->Name[hint]);
doesn't work what is the correct combination ?
gabby
|
|
|
|
|
Respected All
I already sent my query to this forum but still no +ve response.I cant sent Source Code because too lengthy.
------------------------------------------------------------------
Actually I have a number of bitmaps that are listed in a ListBox, when i executed my program then on first Dialog Box a listBox came in and i select any one bitmap from the list and the bitmap displayed along with respective data on Bitmap on different position usind dc.textout()function in 2nd dialog box which i have already created.
Now when I close the 2nd dialog window then the first still exist there and I can select another bitmap to display but when i select another bitmap from the listbox then the selected bitmap has been displayed but the respective data that should be displayed on different position can't dispalyed and show an error that debug it.
I did not load bitmap in OnPaint() function but actually i am loading in 2nd class.
Hope my expalnation will help u people.
david
|
|
|
|
|
Handle the WM_CLOSE message of the second dialog. Just Hide the dialog instead of destroying it, like: ShowWindow(SW_HIDE); Also handle the OnOK() and OnCancel() functions, so that the dialog cannot be destroyed.
Create the second dialog in the OnInitDialog() of the first dialog. Keep the handle of the second dialog as a member variable in the first class, like:
CSecondDialog m_SecondDialog;
In the OnInitDialog() of the first:
m_SecondDialog.Create(IDD_WHATEVER,this);
When you need to show the second dialog, just show it:
m_SecondDialog.ShowWindow(SW_SHOW);
this is this.
|
|
|
|
|
Hi!
I'm trying to find an article of any good example of how to implement a drag and drop Button Control. I want this button to be dragged and across the Dialog and then dropped on another buttun which generates a MessageBox saying that Drag And Drop works. Should be simple but I can't find any good information or anyone that can help me out.
Maybe dragging and dropping an image would make it more simple.
Or any other type of Control.
Every example I get, is of dragging items in a TreeCtrl or just text in an Edit Control. I want the whole Control to be dragged.
Please Help!
|
|
|
|
|
Hello...
I like to implement WriteFileEx / ReadFileEx in one of my classes...
Is there any safe way to implement LPOVERLAPPED_COMPLETION_ROUTINE as a (non static) member function ?
Thx...
-- modified at 5:09 Wednesday 14th September, 2005
|
|
|
|
|
Off the top of my head (i.e. untested) do something like this:
#define IOOP_READ 1
#define IOOP_WRITE 2
#define CK_CONTAINING_RECORD( PTR, TYP, FLD ) \
( (TYP*)( (byte*)(PTR) - (byte*)(&((TYP*)0)->FLD) ) )
class MyFile;
class MyOL : public OVERLAPPED {
public:
virtual ~MyOL( void ) {
if( Buff ) delete [] Buff;
}
MyFile *File;
DWORD Op;
DWORD Cnt;
char *Buff;
OVERLAPPED Ptr( void ) { return(&Internal); }
};
class MyFile {
protected:
HANDLE hnd;
static void CALLBACK iocr( DWORD ERR, DWORD CNT, OVERLAPPED *OL ) {
if( !OL ) return;
MyOL *ol = CK_CONTAINING_RECORD(OL, MyOL, Internal);
ol->Cnt = CNT;
ol->File->OnIOC(ol);
delete ol;
}
void onIOC( MyOL *OL ) {
switch( OL->Op ) {
case IOOP_READ : ...
case IOOP_WRITE : ...
}
}
public:
bool ReadEx( DWORD SZ ) {
if( !SZ ) return(false);
MyOL *ol = new MyOL();
ol->Op = IOOP_READ;
ol->File = this;
ol->Buff = new char[SZ];
return( ReadFileEx(hnd, ol->Buff, SZ, ol->Ptr(), iocr) );
}
bool WriteEx( DWORD SZ, void *BUFF ) {
if( !SZ || !BUFF ) return(false);
MyOL *ol = new MyOL();
ol->Op = IOOP_WRITE;
ol->File = this;
ol->Buff = new char[SZ];
memcpy(ol->Buff, BUFF, SZ);
return( WriteFileEx(hnd, ol->Buff, SZ, ol->Ptr(), iocr) );
}
};
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hello...
This is very guru like solution...
Big Thx, greets from germany...
|
|
|
|
|
Hi,
I hope someone can help me with the following problem:
I have to download several web pages and search for a special number or text in this sites.
If the number or the text is found, the adress of the page should be displayed.
So, now my problem is that I don't know how to download a page? Does anyone have a sample?
The other problem is that before this web pages can be displayed in IE or Firefox you have to enter a username and password!
Regards,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
Daniel Strigl wrote:
So, now my problem is that I don't know how to download a page? Does anyone have a sample?
Try This
http://www.codeproject.com/internet/amhttputils.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hello friend,
i want a help regarding retrieving data from a Window's Edit boxes.
The situation is like this:There is a window( seems to be a dialog box produced by some Application). The window is containing many sub windows(controls inside it). my requirement is to read the data present in those controls/sub windows/edit boxes.
The extent to which i have come is, able to get a handle to that edit box( of class CWND). with that handle it is also working if i try to enable/disable all windows/controls present in a maibn parent window . if i am using the function ::GetWindowText(), i am not getting the text in that edit box( where as for all button window i am getting their captions like &OK,&Edit e.t.c).
please tell me how to access the text present in the editboxes.
and my problem is like this said above in last paragraph.
|
|
|
|
|
please post the code where you are using GetWindowText() because it should work.
CEdit* pEdit = ;
CString strText = "";
pEdit->GetWindowText(strText);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
please validate the code here if sth is wrong. Only the case for edit box controls it is not working , i am tinking if any locking they have done there. have tried many other options also all of them commented in the below code.
the main window therei is 'System Event" from which i anm trying to read the contents of all its sub windows( edit boxes e.t.c)
void WManip(CWnd *WndActiveChild ,CWnd *WndParent)
{
CWnd * WndActiveChildRead;
CEdit *WndEdit;
LPTSTR EditText;
COleDataObject ClipObj;
tagSTGMEDIUM *strVar;
LPCTSTR lpctFormat;
int ControlID,WinCount = 0;
CString rString,temprString,text;
WndActiveChild->SetForegroundWindow();
WndActiveChild->SetFocus();
// WndActiveChild->OpenClipboard();
// if (( (WndActiveChild->GetClipboardOwner()) ->GetWindowText(rString) ) != 0 )
// (WndActiveChild->GetClipboardOwner()) ->GetWindowText(rString);
// if (rString != "")
// AfxMessageBox("some thingn hapend "+rString);
ControlID = WndActiveChild->GetDlgCtrlID();
WndActiveChild->GetWindowText(rString);
AfxMessageBox(rString);
//WndEdit = WndActiveChild ;
// ClipObj.AttachClipboard();
// strVar = new tagSTGMEDIUM;
// ClipObj.GetData(CF_TEXT, strVar,NULL);
// WndActiveChild ->GetLine(0,EditText);
// WndParent ->GetDlgItemText(ControlID,rString);
// temprString.Format("%s%d%s", (LPCTSTR) rString,ControlID, (LPCTSTR)EditText ); //(LPCTSTR) rString,
AfxMessageBox(temprString);
// the following code is just for testing i have put.
if (rString.Compare("&Edit") == 0)
{
WndActiveChild->PostMessage(WM_LBUTTONDOWN,0,0);
Sleep(50);
WndActiveChild->PostMessage(WM_LBUTTONUP,0,0);
// WndParent->CheckDlgButton(i,1);
}
// WndActiveChild->EnableWindow(false);
WinCount ++;
}
void CConfigTool_AutomateDlg::OnOK()
{
int i,WinCount = 0;
CString rString,temprString,text;
CEdit EControl;
CWnd * pActWindow,*pActChildWindow,*pActChild1Window, *pActChild2Window ;
// pActWindow = CWnd::GetActiveWindow();
pActWindow = CWnd::FindWindow(NULL ,"System Event");
pActWindow->SetForegroundWindow();
// pActWindow->ShowWindow(SW_SHOWMAXIMIZED);
pActChildWindow = pActWindow->GetTopWindow();
while (pActChildWindow != NULL)
{
WinCount ++;
pActChild1Window = pActChildWindow->GetTopWindow();
while(pActChild1Window != NULL)
{
WinCount ++;
/* pActChild2Window = pActChildWindow->GetTopWindow();
while(pActChild2Window != NULL)
{
WinCount ++;
WManip(pActChild2Window,pActChild1Window);
pActChild2Window = pActChild2Window->GetNextWindow(GW_HWNDNEXT);
} */
WManip(pActChild1Window,pActChildWindow);
pActChild1Window = pActChild1Window->GetNextWindow(GW_HWNDNEXT);
}
WManip(pActChildWindow,pActWindow);
pActChildWindow = pActChildWindow->GetNextWindow(GW_HWNDNEXT);
}
// temprString.Format("%s%d", "Total number of windows" , i);
// AfxMessageBox(temprString);
if (CanExit())
CDialog::OnOK();
}
|
|
|
|
|
did you really think that i was going to read that entiere code ?
first of all, if you one anyone reading and validating it, put it into <pre></pre> tags to be more readable. moreover, i just asked for the code where you were using the GetWindowText(), not the whole one... so, please use the [modify] link at the bottom of your post...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
did you really think that i was going to read that entiere code ?
Cool Down brother....
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hum, yes, i know i must calm down, but it's really bothering to see how many people post so useless questions...
we are obliged to ask one more question and overload the servers to try to understand what the guy wanted us to solve...
OT: i'm really really really sorry for series II && III ; i'm ending my classes in one week, and i have to prepared hard my next job (and i'm not even sure where i will work at this date !)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
: i'm really really really sorry for series II && III ; i'm ending my classes in one week, and i have to prepared hard my next job
No Problem Buddy, I will Manage
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
please look into the below code equivalent to then pvevious one after removing all the redundant lines. please let meknow about: given any window how to obtain information of all the data present in the window.
please suggest me a method or any example code to do the following
requirement is as below:
input: window
Output:
details of various items present in the window and their content as far as possible.
Maincallingfunction()
{
WND * wndparent,*wndchild1,*wndchild2;
wndparent = Findwindow("WindowName");
cwndchild1= wndparent->GetTopWindow();
while(wncdhild1!= NULL)
{
GetWindowContent(wndchild,wndparent);
wndchild2= wndchild1->GetTopWindow();
while(wncdhild2!= NULL)
{
GetWindowContent(wndchild,wndparent);
wndchild2= wndchild2->GetNextWindow()
}
wndchild1= wndchild1->GetNextWindow();
}
}
void GetWindowContent(CWnd *WndActiveChild ,CWnd *WndParent)
{
CWnd * WndActiveChildRead;
CEdit *WndEdit;
LPTSTR EditText;
COleDataObject ClipObj;
tagSTGMEDIUM *strVar;
LPCTSTR lpctFormat;
int ControlID,WinCount = 0;
CString rString,temprString,text;
// code starting from here
WndActiveChild->SetForegroundWindow();
WndActiveChild->SetFocus();
ControlID = WndActiveChild->GetDlgCtrlID();
WndActiveChild->GetWindowText(rString);
AfxMessageBox(rString);
}
-- modified at 7:13 Wednesday 14th September, 2005
|
|
|
|
|
teja_tejaswi wrote:
WND * wndparent,*wndchild1,*wndchild2;
wndparent = Findwindow("WindowName");
cwndchild1= wndparent->GetTopWindow();
If you trying to retrieve content from Window/Edit box thats belong to some other process... then GetWindowText(..) api will not work..
You have to use WM_GETTEXT and WM_GETTEXTLENGTH message to reterive the text of that window.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
You cant read the edit box because it not in you process however do not fret
lResult = SendMessage(
// returns LRESULT in lResult
(HWND) hWndControl,
// handle to destination control
(UINT) WM_GETTEXT,
// message ID
(WPARAM) wParam,
// = (WPARAM) () wParam;
(LPARAM) lParam
// = (LPARAM) () lParam;
);
Look up further documentation on the web but this will take care of your problem.
|
|
|
|
|
ky_rerun wrote:
WM_GETTEXT,
Sorry if I sound Rude.., I believe same thing is mentioned by me around 15 hr prior to your post.... Please check other comments before posting..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello,
At the moment Im writing on a code-comment macro that shall automatically generate comment-dummys for namespaces, classes, functions, etc., because I want to use my code with doxygen.
After matching with several problems Ive come to a problem I cannot solve myself.
Im using the CodeElements Interface to go through all elements and use the Comment-member of the CodeElement (eg. CodeClass) to set my comment-dummy.
In fact the problem is quite simple:
Visual Studio only assigns a comment to a CodeElement when it is looking like that:
// bla blub
// further blubb
but not if it looks like that
/* hrhr
*/
or that
//! codecomment
It wouldnt be any problem to make comments that are accepted by doxygen, but these comments are not assigned to the CodeElement and this way are not shown in the information-window that opens when you are goind to use the function in your source.
Is there a way to change this visual studio behaviour, so it would accept a comment like this as the comment assigned to the function?
/* void JustDoingSomething()
\brief does something
*/
void JustDoingSomething();
|
|
|
|
|
Hm, just forget about it - my visual studio now also shows the other comments - no idea why this wasnt the case before...
|
|
|
|
|