|
Hi,
I am using a SCADA application for some control systems, but I don't want the user to be able to drag the application window by using the titlebar. The only option I have left on the titlebar is to close and that is restricted by user privileges within the application.
I can't do away with the titlebar as it has some menus I want to keep, that are specific to the application. I tried the manufacturer of the package and they were as helpful as a chocolate fireguard.
Is there a way to stop mouse clicks being detected as a general OS rule, either by a VBScript or maybe a registry edit. I am running Win XP Pro SP2.
Thanks,
Jon.
|
|
|
|
|
Perhaps you could override the window procedure and fiddle with the WM_MOVING and WM_WINDOWPOSCHANGING notifications in some way
|
|
|
|
|
How do I store image into the database in Microsoft SQL
|
|
|
|
|
Google broken where you live ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Or the forum search tool? It's not like this gets asked weekly.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
When I am dragging a column divider,sysheader32 will issue HDN_TRACK Notification.But the interval of this notification (column width changing) is not by 1 pixel step. How to get notification by every 1 pixel changing?
I want to implement ColMaxWidth and ColMinWidth property into vbaccelerator’s sGrid2.When I am dragging the divider of a column, the column will stop resizing when column width is reaching the colmaxwidth or colminwidth boundary.
I am checking the mouse position or lWidth in sub m_cHeader_ColumnWidthChanging,if Column Width is reaching the colmaxwidth or colminwidth boundary,then I use ClipCursor API to restrict mouse movement. But the problem is that Header's HDN_TRACK notification is not being sent by 1 pixel change . When I got the notification,the column width has been changed by more than 1 pixel.That is why I can't control the column width accurately. e.g. the Max. Column width is set to 100,The min. Column Width is 50,But somehow,the Column width is going to 48 or 102,not the exact 50 or 100 while resizing.
The notification sequence is :
WM_MouseMove, WM_LBUTTONDOWN, HDN_BEGINTRACK, WM_MOUSEMOVE, HDN_TRACK, WM_MOUSEMOVE, HDN_TRACK, WM_MOUSEMOVE, HDN_TRACK ... WM_MOUSEMOVE, HDN_TRACK, HDN_ENDTRACK
[Note]The problem is that the notification is not being sent by per pixel by per pixel. If I am moving mouse very fast, Mouse will over the boundary of ColMaxWidth and ColMinWidth by few pixels.
in Header Class,I am Subclassing those related notifications:
Case HDN_TRACKA, HDN_TRACKW
CopyMemory tHDN, ByVal lParam, LenB(tHDN)
'/* Get HD_ITEM from tHDN.lPtrHDItem. Don't use a HD_ITEM
'/* structure - you will crash...
'
Private Sub m_cHeader_ColumnWidthChanging(ByVal lColumn As Long, _
lWidth As Long, _
bCancel As Boolean)
Dim iCol As Long
Dim iIntCol As Long
Dim tR As RECT
Dim tClipRect As RECT
Dim iCurrentCol As Long
For iCol = 1 To m_iCols
If (m_tCols(iCol).lHeaderColIndex = lColumn + 1) Then
iCurrentCol = iCol
End If
Next
If Not m_tCols(iCurrentCol).lMaxWidth = -1 Then
If lWidth > m_tCols(iCurrentCol).lMaxWidth Then
ClipCursorRect tClipRect
End If
End If
If Not m_tCols(iCurrentCol).lMinWidth = -1 Then
If lWidth < m_tCols(iCurrentCol).lMinWidth Then
ClipCursorRect tClipRect
End If
End If
pGetDragImageRect lColumn, lWidth, tR, False
DrawDragImage tR, False, False
RaiseEvent ColumnWidthChanging(lColumn, lWidth, bCancel)
If bCancel Then
DrawDragImage tR, False, True
End If
End Sub
Private Sub pGerClipColRect(ByVal lCol As Long, _
ByVal lMaxWidth As Long, _
ByVal lMinWidth As Long, _
ByRef tR As RECT)
Dim iCol As Long
Dim iGCol As Long
Dim tP As POINTAPI
'/* Find RECT for header column with Max and Min Width to stop sizing when out of boundary:
If lCol > 0 Then
'
[Chinese]当拖动Header的分界线时候,会发出HDN_TRACK消息(Notification)。问题是HDN_TRACK消息的发出间隔不是1 pixels by 1 pixels,可能多过一个Pixels.请问要用什么办法可以获得sysheader32的Column每改变1 pixels消息?
|
|
|
|
|
Case close.
Should concerns tp.x and column original right coordinate when getting HDN_BEGINTRACK notification.
|
|
|
|
|
i spent 2 days, 48 hours on this to disable the sound but there is nooooooooooo fu***** solution i am crazy anymore!!
i to do with registry and than refresh explorer [NOTHING]
i tried rename file before navigation start and rename after [NOTHING]
i tried move and delete file [NOTHING]
i tried to delete all strings in registry with "Windows XP Start.wav" [NOTHING]
i tried even this:
<br />
Imports System<br />
Imports Microsoft.Win32<br />
Imports System.Runtime.InteropServices<br />
<br />
Module [aclickdisabler]<br />
Dim HisSoundO, HisSoundM As String<br />
<br />
<br />
<br />
Private Sub readKey()<br />
On Error Resume Next<br />
Dim oReg As RegistryKey<br />
Dim tmpS As String<br />
oReg = Registry.CurrentUser.OpenSubKey("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current")<br />
tmpS = oReg.GetValue("", "").ToString '%SystemRoot%\media\Windows XP Start.wav<br />
oReg.Close()<br />
<br />
If tmpS = "" Then<br />
Else<br />
If tmpS.Contains(":\") Then<br />
Else<br />
tmpS = "C:\WINDOWS\Media\" + tmpS<br />
End If<br />
HisSoundO = tmpS<br />
HisSoundM = System.IO.Path.GetDirectoryName(HisSoundO) & "\" & System.IO.Path.GetFileNameWithoutExtension(HisSoundO) & ".blocked"<br />
End If<br />
<br />
End Sub<br />
<br />
Public Sub ED_Navigate_Sound(ByVal Enabled As Boolean)<br />
'On Error Resume Next<br />
<br />
Dim oReg As RegistryKey<br />
oReg = Registry.CurrentUser.OpenSubKey("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Default", True)<br />
oReg.SetValue("", "C:\Windows\f***in_non_exsisting_file.wav")<br />
oReg.Close()<br />
<br />
readKey()<br />
<br />
'MsgBox(HisSoundO + "-" + HisSoundM)<br />
If Enabled = True Then<br />
System.IO.File.Move(HisSoundM, HisSoundO)<br />
'My.Computer.FileSystem.RenameFile(HisSoundM, HisSoundO)<br />
'Dim oReg As RegistryKey<br />
'oReg = Registry.CurrentUser.OpenSubKey("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current", True)<br />
'oReg.SetValue("", HisSound, RegistryValueKind.ExpandString)<br />
'oReg.Close()<br />
ElseIf Enabled = False Then<br />
System.IO.File.Move(HisSoundO, HisSoundM)<br />
'Kill(HisSoundO)<br />
'My.Computer.FileSystem.RenameFile(HisSoundO, HisSoundM)<br />
'Dim oReg As RegistryKey<br />
'oReg = Registry.CurrentUser.OpenSubKey("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current", True)<br />
'oReg.SetValue("", "", RegistryValueKind.ExpandString)<br />
'oReg.Close()<br />
End If<br />
<br />
End Sub<br />
<br />
End Module [NOTHING]<br />
i tried all buth it allways plays f***in default navigation "čing čing" waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
anyone knows a solution?
|
|
|
|
|
Suddenly
i created new project inserted webbrowser and put on load navigate to Google and guess what no sound no "čing čing" then i started my original application and yeeeeeeee no sound, hope it will work forewer! so solution is up there if someone need's it.
|
|
|
|
|
me again two more things to do to be sure it will work always just edit this two:
FeRtoll wrote: tmpS = "C:\WINDOWS\Media\" + tmpS
tmpS = System.Environment.ExpandEnvironmentVariables("%WinDir%") + "\Media\" + tmpS
and
FeRtoll wrote: 'On Error Resume Next
On Error Resume Next
|
|
|
|
|
sometimes it works sometimes don't what can i do???? anyone?
|
|
|
|
|
|
Dont know why it is'nt working , but instead of having an extra component with your application you can just add some values to the registry and add menus
I know, its not written in Visual Basic, but its close to VB as its written in VB script, but you can easily figure out how it works heres the link: http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/computermanagement/desktop/
And heres the actualy code if you don't want to go to that website :
Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite "HKCR\Folder\Shell\MenuText\Command\", _
"cmd.exe /k cd " & chr(34) & "%1" & chr(34)
objShell.RegWrite "HKCR\Folder\Shell\MenuText\", "Command Prompt Here"
PS. Sorry about poor grammar/spelling too tired to think at the moment
|
|
|
|
|
Thanks, but this is handy for 1 or 2 items for the same program. however I use for my program 12 items + a separator in 1 submenu. If I add all this items directly in the submenu it is not properly shown for the user and it look very pushy. So I used this system to have a submenu like winzip, winrar, groove, copy to, ...
Jan
|
|
|
|
|
I am trying to show a modeless userform in VBA Word to make available several editing functions (a floating toolbar in effect). But adding lines of code at run-time makes it impossible to keep the shown form after the caller completes execution.
I am working in Word 2007, using the built-in VBA editor. These modules are part of a custom built template.
I am adding the buttons at run time to simplify customisation and loading, since I have separate sets of functions I apply this method to. I do this by iterating the particular code module grouping the procedures I want to make accessible while word processing. This takes place in a module spearate from the form. I can find the code added correctly in the userform afterwards. For example
.AddFromString "Sub CommandButton1_Click()" + vbCr + _
"Unload Me" + vbCr + _
"End Sub"
.AddFromString "Sub " + Proc + "_Click()" + vbCr + _
Title + "." + Proc + vbCr + _
"End Sub"
Produces
Sub CommandButton1_Click()
Unload Me
End Sub
Sub pasteSynonyms_Click()
TextCommandsModule.pasteSynonyms
End Sub
etc
The form is created, and appears intact when the show procedure is called. However, when the calling sub exits (invoked either by a shortcut or with a macrobutton in the text) the form disappears again. Removing the lines that add functionality to the buttons, by adding instructions to the codemodule, overcomes this. But I am left with pretty buttons that dont do anything.
I have tried creating the form at run time. I have tried adding a new instance, declared as global variable, of a form template that I build on, and I have tried using the userform module itself, as default instance. In all cases the form is released and, in the case of a new instance, is also unloaded again. I use other modeless forms in the same application without this problem: I can invoke them and they stay around after the calling sub exits again. The difference is that I call the sub to dynamically modify controls, and that I insert lines of code.
How can I add code and avoid the userform disappearing when the code returns?
modified on Sunday, April 5, 2009 10:11 PM
|
|
|
|
|
I am usin microsoft access as backend database and using dataenvironment in my vb application to connect the database.
The problem I am facing with dataenvironment is when I open any recordset from the dataenvironment it get all the records and hold it in the recordset and if I make changes in any field of the record it does not appear to the other users of the network.
What technique should I use to solve this problem?
THanks in advance.
|
|
|
|
|
ejaz_pk wrote: What technique should I use to solve this problem?
Diplomacy
The problem is that Access was meant as a desktop-database, not as a grand-central that can update multiple clients with live data. There are multiple ways of telling the other clients that data hath been altered and that they should fetch the fresh ones.
A recordset is a snaphot of data. Once the data changes, you'd either need a new recordset or update the one that you got. Rereading the dataset (with something like a refresh-button) might be the best option.
Alternatively, you could create a new table, that lists the tables in Access together with their last-modification date. If you want data from a table, just look into the new table and see if it has been changed. If it has, again, reread the entire recordset.
Hope this helps
I are troll
|
|
|
|
|
I am using vb as front end and microsoft access as backend database.
What I want is when user close the application it should automatically take the backup of the access database.
How I can solve this problem?
Thanks in advance
|
|
|
|
|
Close all connections to the database and zip & copy it to your backup-location
I are troll
|
|
|
|
|
Write Code in Your Form Closing Event.
Copy your data to another location and Zip It.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
hi,
i am going to learn mysql DB.
i am using .net 2.0
i dont no how to connect mysql DB in .net?
where i download mysql from net?
give me solution for me...
thanks in advance
|
|
|
|
|
Google is broken where you live ? There's a whole site on using MySQL in VB. You sure as hell can find the download by googling it.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
hey
Specifically VB and MySQL, there is a very good set of articles there that deal with just that.
You should also have a look at here:
http://www.vbforums.com/showthread.php?t=469872
It deals specifically with connecting to a SQL Database, but the concepts are exactly the same of MySQL.
you may download mysql connector for .net too from following link
http://dev.mysql.com/downloads/connector/net/5.2.html
Hope that helps!!
akhilonly007@gmail.com
|
|
|
|
|
hi,
i am new developer in vb.net.
i have using vb.net2.0 and ms access.
actually i am doing billing project.so i need to print sales page itself.
so how can print page itself ? without going report or report viewer.
example,
customer buy some materials so that time entery the all materials
then print same page itself.now i am doing enter all materials in sales form
then going to report take print out. i dont wont this...
please help for me....
|
|
|
|
|
You should try to create Report Using PrintDocument or DOS Base Printing.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|