diff options
author | George Hazan <george.hazan@gmail.com> | 2012-10-12 19:51:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-10-12 19:51:40 +0000 |
commit | 30c4b3dffcac968f7275bdb0a4509b89bca7af79 (patch) | |
tree | ac2fcfbece175e044905e240df366b1497523fc9 /plugins/SeenPlugin/src/userinfo.cpp | |
parent | 0eaa9b7962e4a0ac6d54c0c8856e0ca7f9d7b110 (diff) |
SeenPlugin converted to Unicode
git-svn-id: http://svn.miranda-ng.org/main/trunk@1896 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SeenPlugin/src/userinfo.cpp')
-rw-r--r-- | plugins/SeenPlugin/src/userinfo.cpp | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 48d6523818..a40d83f043 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -38,57 +38,52 @@ extern DWORD dwmirver; BOOL CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
switch(msg){
- case WM_SETCURSOR:
- SetCursor(LoadCursor(NULL,IDC_ARROW));
- return 1;
-
- default:
- break;
+ case WM_SETCURSOR:
+ SetCursor(LoadCursor(NULL,IDC_ARROW));
+ return 1;
}
return CallWindowProc(MainProc,hdlg,msg,wparam,lparam);
}
-
-
INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
- char *szout;
DBVARIANT dbv;
- switch(msg){
-
- case WM_INITDIALOG:
- MainProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hdlg,IDC_INFOTEXT),GWLP_WNDPROC,(LONG)EditProc);
- szout = _strdup(ParseString((!DBGetContactSetting(NULL,S_MOD,"UserStamp",&dbv)?dbv.pszVal:DEFAULT_USERSTAMP),(HANDLE)lparam,0));
- SetDlgItemText(hdlg,IDC_INFOTEXT,szout);
- if (!strcmp(szout,Translate("<unknown>")))
- EnableWindow(GetDlgItem(hdlg,IDC_INFOTEXT),FALSE);
- free(szout);
- DBFreeVariant(&dbv);
- break;
-
- case WM_COMMAND:
- if(HIWORD(wparam)==EN_SETFOCUS)
- SetFocus(GetParent(hdlg));
- break;
+ switch(msg) {
+ case WM_INITDIALOG:
+ MainProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hdlg,IDC_INFOTEXT),GWLP_WNDPROC,(LONG)EditProc);
+ {
+ TCHAR *szout;
+ if ( !DBGetContactSettingTString(NULL, S_MOD, "UserStamp", &dbv)) {
+ szout = ParseString(dbv.ptszVal, (HANDLE)lparam, 0);
+ db_free(&dbv);
+ }
+ else szout = ParseString(DEFAULT_USERSTAMP, (HANDLE)lparam, 0);
+
+ SetDlgItemText(hdlg, IDC_INFOTEXT, szout);
+ if ( !lstrcmp(szout, TranslateT("<unknown>")))
+ EnableWindow( GetDlgItem(hdlg,IDC_INFOTEXT), FALSE);
+ }
+ break;
+
+ case WM_COMMAND:
+ if (HIWORD(wparam) == EN_SETFOCUS)
+ SetFocus( GetParent(hdlg));
+ break;
}
return 0;
}
-
-
int UserinfoInit(WPARAM wparam,LPARAM lparam)
{
- char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,lparam,0);
- if (IsWatchedProtocol(proto)) {
- OPTIONSDIALOGPAGE uip;
- ZeroMemory(&uip,sizeof(uip));
- uip.cbSize=sizeof(uip);
- uip.hInstance=hInstance;
- uip.pszTemplate=MAKEINTRESOURCE(IDD_USERINFO);
- uip.pszTitle="Last seen";
- uip.pfnDlgProc=UserinfoDlgProc;
+ char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, lparam, 0);
+ if ( IsWatchedProtocol(proto)) {
+ OPTIONSDIALOGPAGE uip = { sizeof(uip) };
+ uip.hInstance = hInstance;
+ uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
+ uip.pszTitle = "Last seen";
+ uip.pfnDlgProc = UserinfoDlgProc;
UserInfo_AddPage(wparam, &uip);
}
return 0;
|