15,901,205 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by clintoaug (Top 15 by date)
clintoaug
4-Sep-14 2:55am
View
Deleted
-------------
clintoaug
4-Sep-14 2:53am
View
Deleted
----------
clintoaug
21-Aug-14 8:07am
View
Deleted
----------
clintoaug
21-Aug-14 8:05am
View
Deleted
-----------
clintoaug
6-Aug-14 16:02pm
View
Deleted
============
clintoaug
5-Aug-14 10:35am
View
Deleted
target.MouseDown += new MouseEventHandler(target_MouseDown);
target.MouseMove += new MouseEventHandler(target_MouseMove);
target.Click += new EventHandler(target_Click);
if (showResizeBoxes)
ShowResizeBoxes();
IsVisible(false);
}
private void IsVisible(bool value)
{
topBox.Visible = value;
topLeftBox.Visible = value;
topRightBox.Visible = value;
leftBox.Visible = value;
rightBox.Visible = value;
bottomBox.Visible = value;
bottomLeftBox.Visible = value;
bottomRightBox.Visible = value;
}
void target_Click(object sender, EventArgs e)
{
IsVisible(true);
}
void target_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
MouseDownLocation = e.Location;
}
}
void target_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
Target.Left = e.X + Target.Left - MouseDownLocation.X;
Target.Top = e.Y + Target.Top - MouseDownLocation.Y;
ShowResizeBoxes();
}
}
clintoaug
15-Jul-14 8:43am
View
Deleted
-----
clintoaug
15-Jul-14 8:42am
View
Deleted
------------
clintoaug
10-Jul-14 10:45am
View
Deleted
// $(document).ready(function () {
// updateImageSize();
// $(window).resize(function () {
// updateImageSize();
// });
// });
// function updateImageSize() {
// $(".chart").each(function () {
// var ratio_cont = jQuery(this).width() / jQuery(this).height();
// var $img = jQuery(this).find("img");
// var ratio_img = $img.width() / $img.height();
// if (ratio_cont > ratio_img) {
// $img.css({ "width": "100%", "height": "auto" });
// }
// else if (ratio_cont < ratio_img) {
// $img.css({ "width": "auto", "height": "100%" });
// }
// }); //missing )
// };
clintoaug
10-Jul-14 10:44am
View
Deleted
function resize_div() {
$("img").width($("img").parent().outerWidth() - 20);
}
$(document).ready(function() {
resize_div();
});
$(window).resize(
function() {
resize_div();
}
);
clintoaug
7-May-14 8:36am
View
Thanks for the reply
but its not working.
clintoaug
10-Apr-14 4:37am
View
Deleted
For close active message, i refer these
MessageBox with Ok
http://stackoverflow.com/questions/12532812/how-to-suppress-a-dialog-box-displayed-by-code-that-i-cant-change
MessabeBoxWith Yes or No
http://stackoverflow.com/questions/16797370/click-a-messagebox-button-programmatically
#region MessageBox Closing Method
//// === Close MessageBox Programcaticaly, other than MessageBoxButton.yesNo type ===============
//// === Programaticaly click on MessageBox No button
//// ============================================================================================
private bool cancelled;
// P/Invoke declarations
private delegate bool EnumThreadWndProc(IntPtr hWnd, IntPtr lp);
[DllImport("user32.dll")]
private static extern bool EnumThreadWindows(int tid, EnumThreadWndProc callback, IntPtr lp);
[DllImport("kernel32.dll")]
private static extern int GetCurrentThreadId();
[DllImport("user32.dll")]
private static extern int GetClassName(IntPtr hWnd, StringBuilder buffer, int buflen);
[DllImport("user32.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
////public class DialogCloser : IDisposable
////{
public void CloseActiveMessageBoxOnApplicationIdle()
{
//if (Application.OpenForms.Count == 0) throw new InvalidOperationException();
//Application.OpenForms[0].BeginInvoke(new Action(() =>
//{
// Enumerate windows to find dialogs
if (cancelled) return;
EnumThreadWndProc callback = new EnumThreadWndProc(checkWindow);
EnumThreadWindows(GetCurrentThreadId(), callback, IntPtr.Zero);
GC.KeepAlive(callback);
//}));
}
public void Dispose()
{
cancelled = true;
}
private static bool checkWindow(IntPtr hWnd, IntPtr lp)
{
// Checks if <hwnd> is a Windows dialog
StringBuilder sb = new StringBuilder(260);
GetClassName(hWnd, sb, sb.Capacity);
if (sb.ToString() == "#32770")
{
// Programaticaly click on 'X' button on MessageBox
// Close it by sending WM_CLOSE to the window (MessageBox.OK, OkCancel, type)
SendMessage(hWnd, 0x0010, IntPtr.Zero, IntPtr.Zero);
// Programaticaly click on 'No' button on MessageBox
// Close MessageBox.YesNo type
EnumChildWindows(hWnd, EnumChildWindowsCallback, IntPtr.Zero);
}
return true;
}
//// === End Close MessageBox Programcaticaly, other than MessageBoxButton.yesNo type ===========
//// ============================================================================================
//// =========== Close MessageBox.YesNo type ====================================================
//// =========== Programcaticaly click on MessageBox No button. =================================
//// ============================================================================================
[DllImport("user32")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i);
//[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
//private static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);
[DllImport("user32.dll", EntryPoint = "GetWindowText", CharSet = CharSet.Auto)]
private static extern IntPtr GetWindowCaption(IntPtr hwnd, StringBuilder lpString, int maxCount);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32.dll", SetLastError = true)]
private static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
clintoaug
10-Apr-14 4:36am
View
Deleted
--------
clintoaug
3-Apr-14 6:51am
View
Hi
Using this one we can solve the MessageBox.YesNo type
http://stackoverflow.com/questions/16797370/click-a-messagebox-button-programmatically
clintoaug
3-Apr-14 5:14am
View
Hi,
Thanks for the reply.
I try to use "FindWindow" to close the MessageBox. and its working fine except the cases MessageBoxButtons.YesNo, MessageBoxButtons.AbortRetryIgnore
http://social.msdn.microsoft.com/Forums/windows/en-US/d3f89686-e4d0-4bb1-9052-31abef2a9d2a/detecting-message-boxes-and-close-them-automaticaly?forum=winforms
I need to findout a solution for the cases MessageBox like MessageBoxButtons.YesNo, MessageBoxButtons.AbortRetryIgnore
Show More