|
What function you are using to set text to edit control ?
Because, calling SetWindowText or SetHandle clears the Undo flag.
|
|
|
|
|
|
Please tell me if you have another way to set text to EditCtrl
|
|
|
|
|
Use ReplaceSel , in combination with SetSel .
Edit.SetSel(0,-1);
Edit.ReplaceSel("PRASAD",TRUE);
|
|
|
|
|
use ReplaceSel instead.
This method replaces the current selection.
If you want to replace the whole text, use SelSel() before.
|
|
|
|
|
Hi All ,
I am creating the SDI application for showing the Operating system’s drive explorer tree.
This is working fine for all operating system from Win 2K to XP for 32 Bit.
But If I check it for Windows XP 64 bit operating system then It is showing strange behave , my all hierarchy of files and folders is coming properly but Files and folder of C:\windows\system32 directory are not coming properly , here it is showing the files and folders of C:\windows\systemWOW64 directory.
How to show the actual files and folder of C:\\Windows\\system32 directory ????????
I am using the following code snippet.
ShowFileFolder (CString strPath )
{
HANDLE hInstance;
BOOL bContinue=FALSE;
WIN32_FIND_DATA fatr;
int iCheck=0;
int iLocation;
if(strPath.GetAt(strPath.GetLength()-1)!='\\')
strPath=strPath+_T("\\");
if(strPath.GetLength()==3)
iCheck=1;
strPath=strPath+_T("*");
hInstance=FindFirstFile(strPath,&fatr);
do
{
bContinue=FindNextFile(hInstance,&fatr);
if(!(wcscmp(fatr.cFileName ,_T("."))==0) && !(wcscmp(fatr.cFileName,_T(".."))==0) && bContinue)
{
if(fatr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if((iLocation=strPath.ReverseFind('*'))!=-1)
strPath=strPath.Left(iLocation);
ShowFileFolder (strPath);
//AddItemToTree(strPath) ;
}
else
{
if((iLocation=strPath.ReverseFind('*'))!=-1)
strPath=strPath.Left(iLocation);
//AddItemToTree(strPath) ;
}
}
}while(hInstance && bContinue);
FindClose(hInstance);
}
ShowFileFolder (“ C:\\Windows\\system32 ”) and ShowFileFolder (“ C:\\Windows\\systemWOW64 ”) showing the same file folder hierarchy but actually both have diff file folders on Windows XP 64 bit OS
Regards
|
|
|
|
|
ashtwin wrote: my all hierarchy of files and folders is coming properly but Files and folder of C:\windows\system32 directory are not coming properly , here it is showing the files and folders of C:\windows\systemWOW64 directory
This is the correct behavior. Win64 virtualizes some parts of the file system and registry for Win32 apps for compatibility reasons. You can disable this feature by calling Wow64DisableWow64FsRedirection()
|
|
|
|
|
Thanks it is working correctly now.
|
|
|
|
|
Hi,
I need to add a UDP multicast ability to my application.
The problem is that i can send data to the other computers in my group,
but i can't get data from the other computers.
Where can I find a good example for UDP multicast?
I tried googling but can't find a good example.
With best regards,
Eli
|
|
|
|
|
How are you trying to "get data from the other computers"?
Are they sending multicast packets as well?
|
|
|
|
|
Dear All,
I want to stop user interaction with dialogs.
How can i do this ?
Thanks.
bye.
|
|
|
|
|
What do you want to achieve ,exactly ?
|
|
|
|
|
Hi.,
I am doing a remotly managable program. There I want to manage a dialog application that is at client side. Client application having some buttons, menu and all.
I want to disable application window interaction from user so as to user can not modify any changes on that application dialog.
But it shows the status or some stable text. thats it.
Bye.
|
|
|
|
|
Sakthiu wrote: I want to disable application window interaction from user so as to user can not modify any changes on that application dialog.
But it shows the status or some stable text. thats it.
Whats problem then ? If you are showing information as text.
If you are worried about buttons to be clicked( I'm not sure, if they are there), you can always handle them.
|
|
|
|
|
i have two questions.
1)I need to count the items in the list view.
in my project i opened the file dialog and that selected file is display in the
listview if the same file is selected it gives message of duplication of file.
2)i want to set the default value in combo box.
i am using win32 in .net enviorment.
thanks with
amit
|
|
|
|
|
amitmistry_petlad wrote: 1)I need to count the items in the list view.
Use ,
SendMessage( (HWND) hWnd, LB_GETCOUNT, 0,0);
amitmistry_petlad wrote: 2)i want to set the default value in combo box.
I'm not sure, what you want to do ?
|
|
|
|
|
thank you ,gives the count value zero when i debug it.
will it work for listview?
i am not sure but i think it is for listbox not for listview control.
because the listview has some columns so i think we have to find the column number first and then we have to count the items.is it?
do you have any artical on the base of list view count items ? or link?
amit
|
|
|
|
|
amitmistry_petlad wrote: am not sure but i think it is for listbox not for listview control
Yes it is.
For list view , you can use,
SendMessage(hView,LVM_GETITEMCOUNT ,0,0);
|
|
|
|
|
still gives the zero value, after adding files in the listview
here is the code
case CBN_SELCHANGE :
int iCheck = (int)SendMessage((HWND)GetDlgItem(hDlg , IDC_COMBO1 ), CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
if(iCheck !=0)
{
if(iCheck != 2)
{
uploadedFile = util.GetFile(NULL);
}
else
{
uploadedFile = util.BrowserDirectory();
if(uploadedFile != "")
uploadedFile += "\\";
}
if(uploadedFile != "")
{
//Check if the item is already added or not
HWND hwndListbox = GetDlgItem(hDlg,IDC_LIST4);
LRESULT iCount = SendMessage(hwndListbox,LVM_GETCOLUMN,0,0);
bool valid = true;
if(iCount > 0)
{
for(int i=0;i<iCount;i++)
{
WCHAR szInputFile[MAX_PATH];
SendMessage(hwndListbox,LB_GETTEXT,i,(LPARAM)szInputFile);
if(wcslen(szInputFile) > 0)
{
string sIn = util.ConvertWCHARToString(szInputFile);
if(sIn == uploadedFile)
{
valid = false;
MessageBox(hDlg,_T("This item is already added to the list."),_T("Encode"),MB_ICONINFORMATION);
break;
}
}
}
}
amit
|
|
|
|
|
amitmistry_petlad wrote: //Check if the item is already added or not
HWND hwndListbox = GetDlgItem(hDlg,IDC_LIST4);
LRESULT iCount = SendMessage(hwndListbox,LVM_GETCOLUMN,0,0);
It is lisbox , I guess. Then you need to use, LB_GETCOUNT wioth SendMessage .
Does list box contains some item ?
|
|
|
|
|
no,no
please dont guess list box it is list view
dont go on the varibal names and MESSAGE
e.g
hwndListbox,LB_GETTEXT
it is listview dear.
amit
|
|
|
|
|
amitmistry_petlad wrote: hwndListbox
Its really bad coding convention.Thats why I assumed it as list box.
I dont see any reason why ListView_GetItemCount should not work with list view, if it contains items.
|
|
|
|
|
Dear prasad,
well i am new comer in the win32 programming so sorry for asking some stupid
questions.
ListView_GetItemCount(hwndListview);
is working but now there is problem with the fetching out string from the
listview's first 0 column.
1) for string it is not supported,
2)it might support for WCHAR but when i convert it into string its not convert into string it gives ? mark at debugging time.
code :
<br />
string Utility::ConvertWCHARToString(LPCWSTR source)<br />
{<br />
try<br />
{<br />
size_t len = wcslen(source) * sizeof(LPCWSTR);<br />
char* tempOutFile = new char[len];<br />
WideCharToMultiByte(CP_ACP,0,source,-1,tempOutFile,(int)len,NULL,NULL);<br />
@ the time of debugging<br />
string s = tempOutFile;<br />
if(tempOutFile)<br />
{<br />
delete[] tempOutFile;<br />
}<br />
return s;<br />
}<br />
catch(exception ex)<br />
{<br />
throw ex;<br />
}<br />
}<br />
<br />
3)so i have taken char buff[500],
for that it works fine, but when it convert into string(buff_input) it gives first char and terminate .
i also knew the reason for that i have remark when i had debug the code
in char buffer it show me the null(0) value after every character.
like e.g buff[0] | a
buff[1] | 0
buff[2] | b
buff[3] | 0
buff[4] | c
means @ all the odd position it gives me the null so the string will terminate
immidate after buff[1] so it shows first character only when convert into string
ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);
std::string buff_input(buff);
which one is suitable (1),(2),(3)? give me the guide line master
-- modified at 9:19 Wednesday 27th December, 2006
|
|
|
|
|
amitmistry_petlad wrote: means @ all the odd position it gives me the null so the string will terminate
immidate after buff[1] so it shows first character only when convert into string
It is because, you are using UNICODE configuration.
amitmistry_petlad wrote: ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);
std::string buff_input(buff);
Modify this to,
THCAR buff[MAX_PATH]={0};
ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);
std::wstring buff_input(buff);
Remember, TCHAR becomes wchar_t for UNICODE and char for ANSI . And std::wstring you need to use for wide char string(which is case in UNICODE ), in ANSI you need to use std::string .
|
|
|
|
|
Hell All
I want some information about VC++.net that can we use all API in VC++6.0 in VC++.net. Is there any API which can not used in VC++.net but in VC++ 6.0.
Thanks and Regards
Atool
Atool
|
|
|
|
|