Fa تنظیم استاتوس یاهو

Singular

Active Member
ساخت برنامه ای که متن ک داخل ادیت باکس هست یا پاراگراف هست رو بفرسته به استاوس یاهو


دوستان ممنون میشم در این زمینه راهنمایی کنید
 

Singular

Active Member
کسی از دوستان نیستش که منو راهنمایی کنه

این کد زیر هم هست ولی من تجربه و آشنایی کامل رو ندارم

ممنون میشم در این زمینه کمک کنید

HTML:
 					 						Programmatically changing Yahoo Messenger's status 						 							   	 		Comments (23) |  	  	Share 	    						 					 				 		Alright, I'd been looking for this  stuff for a while. I couldn't find any useful resources on the internet  so thought of giving it a try to find out how its actually done. Thought  people like me would be interested in knowing.
 Seems like we need to setup a custom  message in registry and notify yahoo of this change we've made. We need  to set the “HKCU\Software\Yahoo\Pager\Profiles\[current user]\Custom  Msgs\5” to our new status message and send WM_COMMAND message with  wParam set to 392 (write me a mail if you need to know how I figured  this out) to the yahoo messenger's main window(see the code snippet  below to see how current user is retrieved).
 Here is how you can do it in C#(I guess you can figure out the PInvoke declarations)
 private void ChangeYahooStatus (string newStatus)
 {
 // Get the current signed in user
 //
 RegistryKey keyYahooPager = Registry.CurrentUser.OpenSubKey ("Software\\Yahoo\\Pager");
 string sUserName = (string)keyYahooPager.GetValue ("Yahoo! User ID");
 keyYahooPager.Close();
 System.Diagnostics.Debug.WriteLine ("The currently logged in user is " + sUserName); 
  
 // Now open the current user's profile and set the current status message, pass true to
 // OpenSubKey to request write access
 RegistryKey keyYahooCustomMessages = Registry.CurrentUser.OpenSubKey ("Software\\Yahoo\\Pager\\profiles\\" 
 + sUserName + "\\Custom Msgs", true);
  
 // Set the 5th message, seems like yahoo messenger has the functionality to move the newly set
 // message up as the first one.
 keyYahooCustomMessages.SetValue ("5", newStatus);
 keyYahooCustomMessages.Close ();
  
 // We are done setting the value in the registry. We now need to notify y! of this change
 //
  
 // Find the yahoo messenger window and sent it the notification
 // 0x111: WM_COMMAND
 // 0x188: Code 392
 IntPtr hWndY = FindWindow ("YahooBuddyMain", null);
 System.Diagnostics.Debug.WriteLine ("Find window got: " + hWndY.ToString());
 PostMessage (hWndY, 0x111, 0x188, 0);
 

Singular

Active Member
[CSS] Programmatically changing Yahoo Messenger's status
Comments (23) | Share



Alright, I'd been looking for this stuff for a while. I couldn't find any useful resources on the internet so thought of giving it a try to find out how its actually done. Thought people like me would be interested in knowing.
Seems like we need to setup a custom message in registry and notify yahoo of this change we've made. We need to set the “HKCU\Software\Yahoo\Pager\Profiles\[current user]\Custom Msgs\5” to our new status message and send WM_COMMAND message with wParam set to 392 (write me a mail if you need to know how I figured this out) to the yahoo messenger's main window(see the code snippet below to see how current user is retrieved).
Here is how you can do it in C#(I guess you can figure out the PInvoke declarations)
private void ChangeYahooStatus (string newStatus)
{
// Get the current signed in user
//
RegistryKey keyYahooPager = Registry.CurrentUser.OpenSubKey ("Software\\Yahoo\\Pager");
string sUserName = (string)keyYahooPager.GetValue ("Yahoo! User ID");
keyYahooPager.Close();
System.Diagnostics.Debug.WriteLine ("The currently logged in user is " + sUserName);

// Now open the current user's profile and set the current status message, pass true to
// OpenSubKey to request write access
RegistryKey keyYahooCustomMessages = Registry.CurrentUser.OpenSubKey ("Software\\Yahoo\\Pager\\profiles\\"
+ sUserName + "\\Custom Msgs", true);

// Set the 5th message, seems like yahoo messenger has the functionality to move the newly set
// message up as the first one.
keyYahooCustomMessages.SetValue ("5", newStatus);
keyYahooCustomMessages.Close ();

// We are done setting the value in the registry. We now need to notify y! of this change
//

// Find the yahoo messenger window and sent it the notification
// 0x111: WM_COMMAND
// 0x188: Code 392
IntPtr hWndY = FindWindow ("YahooBuddyMain", null);
System.Diagnostics.Debug.WriteLine ("Find window got: " + hWndY.ToString());
PostMessage (hWndY, 0x111, 0x188, 0);[/CSS]
 

nevercom

کاربر متخصص انجمن مولتی مدیا بیلدر
خب این کد چیزی نیست بجز یک تغییر کوچک در رجیستری که براحتی قابل انجام هست
تنها کاری که انجامش دشواره فرستادن دستوری خاص (wm_command) به پنجره ی یاهو هست، که احتمالاً با پلاگین mmbdll بشه انجامش داد.
 

Singular

Active Member
دوست عزیز
nevercom
ممنون از پاسخ
میشه یه نمونه مثال در این زمینه بزارید

یا دوستان دگ ممنون میشم کمکم کنید
 

nevercom

کاربر متخصص انجمن مولتی مدیا بیلدر
انجام اینکار در MMB‌ (با توجه به کد #C که قرار دادید) در دو مرحله انجام میشه:
  1. دریافت و ثبت اطلاعات در رجیستری که توسط پلاگین های متفاوتی مثل SmallPlugin قابل انجام هست.
  2. فرستادن پیغامی خاصی به برنامه ی Yahoo Messenger تا استتوس رو آپدیت کنه.

در مورد اول، کارهایی که نیازه انجام بشه رو توضیح میدم، خودتون برید و مثال های انجمن یا راهنمای پلاگین (برای کار با رجیستری) رو بخونید تا بتونید انجامش بدید، خیلی خیلی هم ساده هست.

اول باید نام کاربری رو که در Yahoo Messenger لاگین هست بدست بیارید تا استتوس رو در کلید مختص به اون کاربر در رجیستری ثبت کنید
باید مقدار کلید "Yahoo! User ID" رو از مسیر زیر بدست بیارید:
کد:
HKEY_CURRENT_USER\SoftwareYahoo\Pager
بعد از اون، با استفاده از مقدار بدست اومده (نام کاربری) آدرسی خاص در رجیستری رو مشخص می کنید که مقدار یک کلید رو تغییر بدید
نام کلید: 5
مقدار جدید: متنی که استتوس جدیدتون هست
مسیر:
کد:
regPath$ = 'HKEY_CURRENT_USER\Software\Yahoo\Pager\profiles\\' + user$ + '\Custom Msgs'
که $user مقداری هست که در دستور اول از رجیستری خوندید.

تا اینجا استتوس جدید رو در رجیستری ثبت کردید، حالا باید به یاهو مسنجر اطلاع بدید که مقدار استتوس رو از رجیستری بخون و آپدیت کن
کد خودتون اشاره میکنه که اگر یک عدد خاص رو برای یاهو مسنجر بفرستیم اینکار رو انجام میده.

اول باید Handle پنجره ی یاهو مسنجر رو بدست بیاریم تا بتونیم پیغام رو براش ارسال کنیم
برای اینکار باید از دستورات API ویندوز استفاده کنیم که پلاگین MMBDLL اینکار رو انجام میده.
کد زیر اینکار رو انجام میده:

کد:
کد:
Path$ = 'User32.dll'
PluginSet("PlugIn","Path$")
PluginRun("PlugIn","Path")


Functions$ = 'FindWindowA'
PluginSet("PlugIn","Functions$")
PluginRun("PlugIn","Functions")


Parameters$ = 'YahooBuddyMain|'
PluginSet("PlugIn","Parameters$")
PluginRun("PlugIn","Parameters")
PluginGet("PlugIn","hwnd$")

حالا باید مقداری خاص رو به پنجره ی موردنظر بفرستیم:

کد:
کد:
Path$ = 'User32.dll'
PluginSet("PlugIn","Path$")
PluginRun("PlugIn","Path")


Functions$ = 'PostMessageA'
PluginSet("PlugIn","Functions$")
PluginRun("PlugIn","Functions")


Parameters$ = hwnd$ + '|0x111|0x188|0'
PluginSet("PlugIn","Parameters$")
PluginRun("PlugIn","Parameters")


ممکنه این کد جواب نده چون MMB دو نوع داده ی ساده بیشتر نداره و توابع API هم حساس به نوع داده هست.
اگر استفاده از این پلاگین جواب نده (خودم ویندوز ندارم که تست کنم) باید یه پلاگین نوشته بشه که اینکار رو انجام بده یا از ابزاری مثل AutoIt استفاده بشه.
 
آخرین ویرایش:

Singular

Active Member
بابت راهنمای ممنون
ولی جواب نگرفتم
کاش میشد یه نمونه مثال درست میکردید... ممنون میشم
 

nevercom

کاربر متخصص انجمن مولتی مدیا بیلدر
دوتا اشتباه تو کدها بود که درستش کردم، ولی همونطور که عرض کردم اگر این پلاگین نتونست اینکار رو انجام بده باید از برنامه های دیگه یا یک پلاگین مخصوص اینکار کمک بگیرید.
 

Singular

Active Member
نتونستم مشکلمو حل کنم
دوستان اگه کسی میتونه یه نمونه مثال درست کنه
خیلی ممنون میشم ازش
تشکر
 

nevercom

کاربر متخصص انجمن مولتی مدیا بیلدر
تا کجا پیش رفتید ؟
کد اول که هندل پنجره رو بدست میاره، مقداری بر میگردونه ؟
 

Singular

Active Member
سلام
هنوز نتونستم استاتوس رو یاهوو ست کنم

و اینکه مقدار دقیقا کدوم شاخه رجیستری باید بنویسیم
و چیکار باید کنیم که نوشته رجستری فراخوانی بشه و تنظیم استاتوس یاهو بشه


یکم گنگه واسم
کاش ی نمونه مثال درست میکردید..ممنون میشم
 

Singular

Active Member
دوستان این یک برنامه جالبی میشه ها
اگر بتونید استاتوس یهو رو تغییر بدید
یا با زبان های دگ همچین کاری بکنید ... کسی نمی تونه ؟؟
ممنون میشم در این زمینه دوستان فعالیتی کنن
 

جدیدترین ارسال ها

بالا