Browse Source

Use IntPtr instead of int in SendMessage P/Invoke declaration.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@913 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
46f232a188
  1. 4
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 24
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Ime.cs
  3. 4
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  4. 33
      src/Main/Base/Project/Resources/ViewGPLDialog.xfrm
  5. 11
      src/Main/Base/Project/Src/Commands/HelpCommands.cs
  6. 39
      src/Main/Base/Project/Src/Gui/Dialogs/ViewGPLDialog.cs
  7. 4
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs
  8. 6
      src/Main/Base/Project/Src/Gui/TreeGrid/DynamicListItem.cs

4
AddIns/ICSharpCode.SharpDevelop.addin

@ -1396,10 +1396,6 @@ @@ -1396,10 +1396,6 @@
class = "ICSharpCode.SharpDevelop.Commands.ViewTipOfTheDay" />
<MenuItem id = "Separator1" type = "Separator" />
<MenuItem id = "ViewGPL"
label = "${res:XML.MainMenu.HelpMenu.GPL}"
icon = "Icons.16x16.CopyLeftIcon"
class = "ICSharpCode.SharpDevelop.Commands.ViewGPL" />
<MenuItem id = "ViewReadme"
label = "${res:XML.MainMenu.HelpMenu.ReadMe}"
link = "home://doc/ReadMe.rtf" />

24
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Ime.cs

@ -58,9 +58,9 @@ namespace ICSharpCode.TextEditor @@ -58,9 +58,9 @@ namespace ICSharpCode.TextEditor
private static extern IntPtr ImmGetDefaultIMEWnd(IntPtr hWnd);
[ DllImport("user32.dll") ]
private static extern int SendMessage(IntPtr hWnd, int msg, int wParam, COMPOSITIONFORM lParam);
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, COMPOSITIONFORM lParam);
[ DllImport("user32.dll") ]
private static extern int SendMessage(IntPtr hWnd, int msg, int wParam, [In, MarshalAs(UnmanagedType.LPStruct)] LOGFONT lParam);
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, [In, MarshalAs(UnmanagedType.LPStruct)] LOGFONT lParam);
[ StructLayout(LayoutKind.Sequential) ]
private class COMPOSITIONFORM
@ -123,11 +123,11 @@ namespace ICSharpCode.TextEditor @@ -123,11 +123,11 @@ namespace ICSharpCode.TextEditor
}
SendMessage(
hIMEWnd,
WM_IME_CONTROL,
IMC_SETCOMPOSITIONFONT,
lf
);
hIMEWnd,
WM_IME_CONTROL,
new IntPtr(IMC_SETCOMPOSITIONFONT),
lf
);
}
public void SetIMEWindowLocation(int x, int y)
@ -143,11 +143,11 @@ namespace ICSharpCode.TextEditor @@ -143,11 +143,11 @@ namespace ICSharpCode.TextEditor
lParam.rcArea = new RECT();
SendMessage(
hIMEWnd,
WM_IME_CONTROL,
IMC_SETCOMPOSITIONWINDOW,
lParam
);
hIMEWnd,
WM_IME_CONTROL,
new IntPtr(IMC_SETCOMPOSITIONWINDOW),
lParam
);
}
}
}

4
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -207,9 +207,6 @@ @@ -207,9 +207,6 @@
<Compile Include="Src\Gui\Dialogs\TreeViewOptions.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\ViewGPLDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\WordCountDialog.cs">
<SubType>Form</SubType>
</Compile>
@ -485,7 +482,6 @@ @@ -485,7 +482,6 @@
<EmbeddedResource Include="Resources\TabbedOptionsDialog.xfrm" />
<EmbeddedResource Include="Resources\TaskListOptions.xfrm" />
<EmbeddedResource Include="Resources\TreeViewOptionsDialog.xfrm" />
<EmbeddedResource Include="Resources\ViewGPLDialog.xfrm" />
<EmbeddedResource Include="Resources\WordCountDialog.xfrm" />
<EmbeddedResource Include="Resources\ICSharpCode.SharpDevelop.snk" />
<EmbeddedResource Include="Resources\BehaviorTextEditorPanel.xfrm" />

33
src/Main/Base/Project/Resources/ViewGPLDialog.xfrm

@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.Form>
<Name value="form" />
<ShowInTaskbar value="False" />
<FormBorderStyle value="FixedDialog" />
<StartPosition value="CenterScreen" />
<ClientSize value="{Width=720, Height=424}" />
<MinimizeBox value="False" />
<DockPadding value="" />
<Text value="${res:Dialog.ViewGPL.DialogName}" />
<AcceptButton value="okButton [System.Windows.Forms.Button], Text: ${res:Global.OKButtonText}" />
<CancelButton value="okButton [System.Windows.Forms.Button], Text: ${res:Global.OKButtonText}" />
<MaximizeBox value="False" />
<Controls>
<System.Windows.Forms.RichTextBox>
<Name value="licenseRichTextBox" />
<ReadOnly value="True" />
<ClientSize value="{Width=700, Height=372}" />
<Location value="{X=8,Y=8}" />
<Text value="" />
<TabIndex value="0" />
</System.Windows.Forms.RichTextBox>
<System.Windows.Forms.Button>
<Name value="okButton" />
<Location value="{X=637,Y=392}" />
<ClientSize value="{Width=75, Height=23}" />
<Text value="${res:Global.OKButtonText}" />
<TabIndex value="1" />
<DialogResult value="OK" />
</System.Windows.Forms.Button>
</Controls>
</System.Windows.Forms.Form>
</Components>

11
src/Main/Base/Project/Src/Commands/HelpCommands.cs

@ -35,17 +35,6 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -35,17 +35,6 @@ namespace ICSharpCode.SharpDevelop.Commands
}
}
public class ViewGPL : AbstractMenuCommand
{
public override void Run()
{
using (ViewGPLDialog totdd = new ViewGPLDialog()) {
totdd.Owner = (Form)WorkbenchSingleton.Workbench;
totdd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
}
}
}
public class LinkCommand : AbstractMenuCommand
{
string site;

39
src/Main/Base/Project/Src/Gui/Dialogs/ViewGPLDialog.cs

@ -1,39 +0,0 @@ @@ -1,39 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Resources;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
namespace ICSharpCode.SharpDevelop.Gui
{
public class ViewGPLDialog : BaseSharpDevelopForm
{
public ViewGPLDialog()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.ViewGPLDialog.xfrm"));
LoadGPL();
}
void LoadGPL()
{
string filename = FileUtility.ApplicationRootPath +
Path.DirectorySeparatorChar + "doc" +
Path.DirectorySeparatorChar + "license.txt";
if (FileUtility.TestFileExists(filename)) {
RichTextBox licenseRichTextBox = (RichTextBox)ControlDictionary["licenseRichTextBox"];
licenseRichTextBox.LoadFile(filename, RichTextBoxStreamType.PlainText);
}
}
}
}

4
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs

@ -204,11 +204,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -204,11 +204,11 @@ namespace ICSharpCode.SharpDevelop.Gui
[System.Security.SuppressUnmanagedCodeSecurityAttribute]
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam);
static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
void SetUpdate(bool update)
{
SendMessage(textEditorControl.Handle, WM_SETREDRAW, update ? 1 : 0, IntPtr.Zero);
SendMessage(textEditorControl.Handle, WM_SETREDRAW, update ? new IntPtr(1) : IntPtr.Zero, IntPtr.Zero);
}
void AppendTextCombined(MessageViewCategory category)

6
src/Main/Base/Project/Src/Gui/TreeGrid/DynamicListItem.cs

@ -316,7 +316,7 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid @@ -316,7 +316,7 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid
public event EventHandler<DynamicListEventArgs> BeginLabelEdit;
public event EventHandler<DynamicListEventArgs> FinishLabelEdit;
public event EventHandler<DynamicListEventArgs> CancelledLabelEdit;
public event EventHandler<DynamicListEventArgs> CanceledLabelEdit;
void HandleLabelEditClick(DynamicList list)
{
@ -332,8 +332,8 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid @@ -332,8 +332,8 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid
if (e2.KeyData == Keys.Enter || e2.KeyData == Keys.Escape) {
e2.Handled = true;
if (e2.KeyData == Keys.Escape) {
if (CancelledLabelEdit != null)
CancelledLabelEdit(this, new DynamicListEventArgs(list));
if (CanceledLabelEdit != null)
CanceledLabelEdit(this, new DynamicListEventArgs(list));
escape = true;
}
this.Control = null;

Loading…
Cancel
Save